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));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }
예제 #5
0
        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;
            }
        }