Пример #1
0
        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));
        }
Пример #2
0
        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));
            }
        }