Ejemplo n.º 1
0
 public List <DelegationItem> GetAll()
 {
     using (var dbContext = new DelegationContext())
     {
         return(dbContext.DelegationItems.ToList());
     }
 }
Ejemplo n.º 2
0
 public void SaveItem(DelegationItem item)
 {
     using (var dbContext = new DelegationContext())
     {
         dbContext.DelegationItems.Add(item);
         dbContext.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 public List <BaseDelegationData> GetBaseData()
 {
     using (var dbContext = new DelegationContext())
     {
         return(dbContext.DelegationItems.ToList().Select(item =>
         {
             return new BaseDelegationData()
             {
                 FirstName = item.FirstName,
                 LastName = item.LastName,
                 Id = item.Id,
                 From = item.Date,
                 To = item.ReturningData
             };
         }).ToList());
     }
 }