Beispiel #1
0
 //Get ALl
 public List <T> GetAll()
 {
     using (PCBVIEntities context = DbContextFactory.Create())// DB컨텍스트
     {
         return(context.Set <T>().ToList());
     }
 }
Beispiel #2
0
 //Get Count 숫자
 public int GetCount()
 {
     using (PCBVIEntities context = DbContextFactory.Create())
     {
         return(context.Set <T>().Count());
     }
 }
Beispiel #3
0
 //삽입
 public void Insert(T entity)
 {
     using (PCBVIEntities context = DbContextFactory.Create())
     {
         context.Set <T>().Add(entity);
         context.SaveChanges();
     }
 }
Beispiel #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));
            }
        }