public Result <StudentResultDTO> CreateStudent(StudentAddModel model) { var check = studentDAL.Get(w => w.UserID == model.UserID && w.Class_ID == model.ClassID); if (check != null) { var checkuser = userDAL.Get(w => w.ID == model.UserID && w.UserType == Entity.Concrete.UserType.Student); if (checkuser == null) { return(new Result <StudentResultDTO>(true, "boyle bir kullanici yok", null)); } Student student = new Student() { UserID = model.UserID, Class_ID = model.ClassID }; studentDAL.Add(student); return(new Result <StudentResultDTO>(false, "isleminizi basari ile gerceklemistir", null)); } else { return(new Result <StudentResultDTO>(true, "boyle bir kayit mevcuttur", null)); } }
/// <summary> /// Save student /// </summary> public void Add(Student model) { //save to database db.Add(model); }
public void Add(Student student) { dal.Add(student); }
public void Insert(Student entity) { _studentDAL.Add(entity); }