public List <TreatmentPercentageModelView> GetPercentage() { using (var treatPerc = new TreatmentPercentageRepository()) { return(treatPerc.GetAll().Select(x => new TreatmentPercentageModelView { TreatmentPercentageId = x.TreatmentPercentageId, Percentage = x.Percentage }).ToList()); } }
public void AddPercentage(TreatmentPercentageModelView model) { using (var feedPerc = new TreatmentPercentageRepository()) { var feed = new TreatmentPercentage { TreatmentPercentageId = model.TreatmentPercentageId, Percentage = model.Percentage + " %" }; feedPerc.Insert(feed); } }