Ejemplo n.º 1
0
 public List <BenefitView> GetAllBenefits()
 {
     using (var bus = new BenefitRepository())
     {
         return(bus.GetAll().Select(x => new BenefitView()
         {
             benefitID = x.benefitID,
             Name = x.Name,
         }).ToList());
     }
 }
Ejemplo n.º 2
0
        public BenefitView GetBenefitByName(string name)
        {
            using (var b = new BenefitRepository())
            {
                var model = new BenefitView();

                foreach (Benefit ben in b.GetAll())
                {
                    if (ben.Name == name)
                    {
                        model.benefitID = ben.benefitID;
                        model.Name      = ben.Name;
                    }
                }
                return(model);
            }
        }