title: Net Core Web Api moq
body: <p>How to call IRepocitory from Nunit test case.
  From postman the debug goes to the linq query , from tdd code the debug does not goes in .
  How to configure nunit test case to call EF core for checking API.</p>
  
  <pre><code>    [HttpPost]
      public async Task&lt;IActionResult&gt; Post([FromBody]HourlyShareRate value)
      {
          if (!ModelState.IsValid)
          {
              return BadRequest(ModelState);
          }
  
          await _shareRepository.InsertAsync(value);
  
          return Created($"Share/{value.Id}", value);
      }
  </code></pre>