public List <ConsumptionDto> GetConsumptions(Int32 userId, DateTime?startDate, DateTime?endDate, Int32 typeId) { return(_consumptionRepository.GetConsumptions(userId, startDate, endDate) .ConvertAll(c => new ConsumptionDto() { Id = c.Id, Date = c.Date, Place = c.Place, Sum = c.Sum, UserId = c.UserId, ConsumptionItems = c.ConsumptionItems.ConvertAll(ci => new ConsumptionItemDto() { Id = ci.Id, Name = ci.Name, Price = ci.Price, Quantity = ci.Quantity }) })); }