Last active
June 12, 2019 06:38
-
-
Save wullemsb/306ea09d81acb2829116d6fe7ed1edf4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET api/products | |
[HttpGet] | |
public ActionResult<IEnumerable<Product>> Get() | |
{ | |
_logger.LogInformation("Getting all products"); | |
using (var uow = _unitOfWorkFactory.Create()) | |
{ | |
var products = _repository.GetProducts(); | |
return products; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IProductRepository: IRepository<Product> | |
{ | |
List<Product> GetProducts(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment