コード例 #1
0
 public ResponseModel Save(Employee employee)
 {
     using (VirtualTraineesEntities db = new VirtualTraineesEntities())
     {
         db.Employees.Add(employee);
         db.SaveChanges();
     }
     return(new ResponseModel());
 }
コード例 #2
0
 public ResponseModel Save(Teacher teacher)
 {
     using (VirtualTraineesEntities db = new VirtualTraineesEntities())
     {
         db.Teachers.Add(teacher);
         db.SaveChanges();
     }
     return(new ResponseModel());
 }
コード例 #3
0
        public ResponseModel GetAll()
        {
            using (VirtualTraineesEntities db = new VirtualTraineesEntities())
            {
                List <Student> students = db.Students.ToList();

                return(new ResponseModel()
                {
                    Data = students
                });
            }
        }
コード例 #4
0
        public ResponseModel GetAll()
        {
            using (VirtualTraineesEntities db = new VirtualTraineesEntities())
            {
                List <Employee> employees = db.Employees.ToList();

                return(new ResponseModel()
                {
                    Data = employees
                });
            }
        }
コード例 #5
0
        public ResponseModel GetAll()
        {
            using (VirtualTraineesEntities db = new VirtualTraineesEntities())
            {
                List <Teacher> teachers = db.Teachers.ToList();

                return(new ResponseModel()
                {
                    Data = teachers
                });
            }
        }