Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Last active June 12, 2019 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wullemsb/306ea09d81acb2829116d6fe7ed1edf4 to your computer and use it in GitHub Desktop.
Save wullemsb/306ea09d81acb2829116d6fe7ed1edf4 to your computer and use it in GitHub Desktop.
// 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;
}
}
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