public async Task <IEnumerable <FoodResponseObject> > FindAllAsync() { var food = await _foodRepository.FindAllAsync(); var parsedItems = food.Select(FoodResponseObject.FromEntity); return(parsedItems); }
public async Task <IList <Food> > FarmReportFoodIn(int premisesId) { int month = DateTime.Now.Month; var result = await _productRepos.FindAllAsync(x => x.FarmId == premisesId && x.CreateDate.Month == month); foreach (var c in result) { c.Category = _categoryRepos.GetById(c.CategoryId); } return(result); }