Ejemplo n.º 1
0
 public int AddHireTypes(IEnumerable <hireType> items)
 {
     using (IOPContext db = new IOPContext())
     {
         HireTypeConverter      converter = new HireTypeConverter(db);
         IEnumerable <HireType> list      = items.Select(p => converter.FromDto(p));
         db.HireTypes.AddRange(list);
         return(db.SaveChanges());
     }
 }
Ejemplo n.º 2
0
 public int UpdateHireTypes(IEnumerable <hireType> items)
 {
     using (IOPContext db = new IOPContext())
     {
         HireTypeConverter converter = new HireTypeConverter(db);
         foreach (var item in items)
         {
             var model = converter.FromDto(item);
             db.Entry(model).State = System.Data.Entity.EntityState.Modified;
         }
         return(db.SaveChanges());
     }
 }