예제 #1
0
파일: ClassServices.cs 프로젝트: hndc9x/FA
        // Create new Class
        public Classes CreateClasses(RequestCreateClasses model)
        {
            var entity = model.ToEntity();

            PrepareCreate(entity);
            return(Add(entity));
        }
예제 #2
0
        public IActionResult CreateClasses([FromBody] RequestCreateClasses _classes)
        {
            Classes entity;

            if (ModelState.IsValid)
            {
                entity = _classServices.CreateClasses(_classes);
                _classServices.Commit();
                return(Created($"api/classes/{entity.Id}", _classes));
            }
            else
            {
                return(BadRequest());
            }
        }