public async Task <IActionResult> AddMeeting(HomeWorksModel homeWorksModel) { var newHomeWork = await _schoolRepository.AddAsync(homeWorksModel); if (newHomeWork == null) { return(BadRequest(new { error = "Invalid Inputs" })); } return(Ok(newHomeWork)); }
public async Task <IActionResult> AddMeeting(MeetingsModel MeetingsModel) { var newMeeting = await _schoolRepository.AddAsync(MeetingsModel); if (newMeeting == null) { return(BadRequest(new { error = "Invalid Inputs" })); } return(Ok(newMeeting)); }
public async Task <IActionResult> AddObject(ObjectsModel objectsModel) { var newObject = await _schoolRepository.AddAsync(objectsModel); if (newObject == null) { return(BadRequest(new { error = "Invalid Inputs" })); } return(Ok(newObject)); }
public async Task <IActionResult> AddClass(classesModel classesModel) { var newClass = await _schoolRepository.AddAsync(classesModel); if (newClass == null) { return(BadRequest(new { error = "Invalid Inputs" })); } return(Ok(newClass)); }
public async Task <IActionResult> PostSchool([FromBody] School school) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await repository.AddAsync(school); await unitOfWork.SaveChangesAsync(); return(Created(Url.Action(nameof(GetSchool)), school)); }
public async Task <dynamic> Create(School school) { try { var data = await _schoolRepository.AddAsync(school); return("Sucessfully"); } catch (Exception e) { return(e.Message); throw; } }