Beispiel #1
0
 public List<Employee> GetEmployeeList()
 {
     using (ModelContext context = new ModelContext("name=conn"))
     {
         return context.Employees.ToList();
     }
 }
Beispiel #2
0
 public int InsertEntity(Employee model)
 {
     using(ModelContext context=new ModelContext("conn"))
     {
         context.Employees.Add(model);
         return context.SaveChanges();
     }
 }