Created
June 12, 2019 06:41
-
-
Save wullemsb/cdbcf3455c24c186bdff974b5fd35033 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
[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; | |
} | |
} |
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