public void Insert(UserDetail userDetail) { using (UserEntities context = DbContextFactory.Create()) { context.Set <UserDetail>().Add(userDetail); context.Entry(userDetail).State = EntityState.Added; context.SaveChanges(); } }
public List <UserDetail> GetAll() { using (UserEntities context = DbContextFactory.Create()) { IQueryable <UserDetail> query = context.Set <UserDetail>(); var list = query.ToList(); return(list); } }