// Create new Class public Classes CreateClasses(RequestCreateClasses model) { var entity = model.ToEntity(); PrepareCreate(entity); return(Add(entity)); }
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()); } }