public IHttpActionResult Add(AddPlayerData command)
        {
            VerifyPermission(Permissions.Create, Modules.PlayerManager);

            var playerData = Mapper.DynamicMap <RegistrationData>(command);

            playerData.IsRegisteredFromAdminSite = true;
            playerData.IpAddress = "127.0.0.1";

            var validationResult = _commands.ValidateThatPlayerCanBeRegistered(playerData);

            if (!validationResult.IsValid)
            {
                return(Ok(ValidationExceptionResponse(validationResult.Errors)));
            }

            _commands.Register(playerData);
            return(Ok(new { Result = "success" }));
        }
示例#2
0
 public HttpResponseMessage AddPlayerInPlayerManager(AddPlayerData request)
 {
     return(WebClient.SecurePostAsJson <AddPlayerData, HttpResponseMessage>(Token, _url + AdminApiRoutes.AddPlayerInPlayerManager, request));
 }