Exemple #1
0
 //Get ALl
 public List <T> GetAll()
 {
     using (PCBVIEntities context = DbContextFactory.Create())// DB컨텍스트
     {
         return(context.Set <T>().ToList());
     }
 }
Exemple #2
0
 //Get Count 숫자
 public int GetCount()
 {
     using (PCBVIEntities context = DbContextFactory.Create())
     {
         return(context.Set <T>().Count());
     }
 }
Exemple #3
0
 //삽입
 public void Insert(T entity)
 {
     using (PCBVIEntities context = DbContextFactory.Create())
     {
         context.Set <T>().Add(entity);
         context.SaveChanges();
     }
 }
Exemple #4
0
        //리스트 등록

        public void InsertALL(List <T> entiList)
        {
            using (PCBVIEntities context = DbContextFactory.Create())
            {
                entiList.ForEach(n => context.Set <T>().Add(n));
                context.SaveChanges();
                // companies.ForEach(n => context.AddToCompanies(n));
            }
        }