Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created June 12, 2019 06:41
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/cdbcf3455c24c186bdff974b5fd35033 to your computer and use it in GitHub Desktop.
Save wullemsb/cdbcf3455c24c186bdff974b5fd35033 to your computer and use it in GitHub Desktop.
[HttpGet]
public ActionResult<IEnumerable<Product>> Get()
{
_logger.LogInformation("Getting all products");
using (var uow = _unitOfWorkFactory.Create())
{
var products = _repository
.GetProducts()
.Where(p=> p.Discontinued=false);
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