public virtual IActionResult CreatTeam([FromBody] Team creatingTeam) { Logger.Info(mLogMessManager.Log("SomeUser", "T001", "Team creation requested.", mReferenceId, new { creatingTeam })); var result = mCore.TeamsApi.CreateTeam(creatingTeam); Logger.Info(mLogMessManager.Log("SomeUser", "T001", "Team creation finished.", mReferenceId)); return(new ObjectResult(result)); }
public virtual IActionResult CreateUser([FromBody] User creatingUser) { Logger.Info(mLogMessManager.Log("SomeUser", Codes.UserCreation, "User creation started.", mReferenceId, new { creatingUser })); try { var result = mCore.UsersApi.CreateUser(creatingUser); Logger.Info(mLogMessManager.Log("SomeUser", Codes.UserCreation, "User created.", mReferenceId)); return(new ObjectResult(result)); } catch (NotValidRequestException exception) { Logger.Error(mLogMessManager.Log("SomeUser", Codes.UserCreation, $"User creation error: {exception.Message}.", mReferenceId)); return(BadRequest(exception.Message)); } }