public async Task <GetPriceLevel> GetPriceLevelForEdit(NullableIdDto input) { var output = new GetPriceLevel { }; var query = _priceLevelRepository.GetAll().Where(p => p.Id == input.Id); if (query.Count() > 0) { var priceLevel = (from a in query select new PriceLevelListDto { Id = a.Id, PriceLevelCode = a.PriceLevelCode, PriceLevelName = a.PriceLevelName, DiscountAllowed = a.DiscountAllowed }).FirstOrDefault(); output = new GetPriceLevel { PriceLevels = priceLevel }; } return(output); }
public async Task <GetPriceLevel> GetPriceLevelForEdit(NullableIdDto input) { var output = new GetPriceLevel { }; var payment = _priceLevelRepository .GetAll().Where(p => p.Id == input.Id).FirstOrDefault(); output.GetPriceLevels = payment.MapTo <PriceLevelCreate>(); return(output); }