public ResponseGetWorkpriceCatalog GetWorkpriceCatalog() { var data = dbManager.GetWorkprices().ToList(); var mData = data.Select(d => new WorkpriceDTO() { ContactPrice = d.ContactPrice, ExactPrice = d.ExactPrice, Id = d.Id, Name = d.Name, Price = d.Price, Unity = d.Unity }).ToList(); return(new ResponseGetWorkpriceCatalog() { Data = mData }); }
public ResponseGetWorkpriceCatalog GetWorkprices(RequestGetWorkprice request) { var response = new ResponseGetWorkpriceCatalog(request?.Paging); var data = dbManager.GetWorkprices(); var result = data.Sorting(request?.Sorting).Pagination(response.Paging).ToList(); var cData = result.Select(t => new WorkpriceDTO() { ContactPrice = t.ContactPrice, ExactPrice = t.ExactPrice, Id = t.Id, Name = t.Name, Price = t.Price, Unity = t.Unity }).ToList(); response.Data = cData; return(response); }