public void InsertStudent(StudentInputInsert model) { var userName = GetUserNameToTokenJWT(); var userId = _userManager.Users.Where(x => x.UserName.ToLower().Equals(userName.ToLower())).Select(x => x.UserId).FirstOrDefault(); _studentcontext.InsertStudent(model, userId); }
public void InsertStudent(StudentInputInsert model, int userId) { var student = new Student(); student.Name = model.Name; student.gender = model.gender; student.DateOfBirth = model.DateOfBirth; student.address = model.address; student.IsDelete = model.IsDelete; _context.Student.Add(student); _context.SaveChanges(); }
public void Insert([FromBody] StudentInputInsert model) { _StudentService.Insert(model); }