Пример #1
0
 public void Insert(UserDetail userDetail)
 {
     using (UserEntities context = DbContextFactory.Create())
     {
         context.Set <UserDetail>().Add(userDetail);
         context.Entry(userDetail).State = EntityState.Added;
         context.SaveChanges();
     }
 }
Пример #2
0
 public List <UserDetail> GetAll()
 {
     using (UserEntities context = DbContextFactory.Create())
     {
         IQueryable <UserDetail> query = context.Set <UserDetail>();
         var list = query.ToList();
         return(list);
     }
 }