public HttpResponseMessage CheckUsername(UpdateRegistrationRequest model)
        {
            SuccessResponse response = new SuccessResponse();

            response.IsDuplicateUsername = RegistrationService.CheckUsername(model.Id, model.Username);
            return(Request.CreateResponse(response));
        }
Example #2
0
        public async Task <RegistrationResponse> UpdateRegistrationAsync(UpdateRegistrationRequest request)
        {
            await EnsureDirectoryAsync().ConfigureAwait(false);

            Info("updating registration");

            return(await PostAsync <RegistrationResponse>(new Uri(request.Location), request).ConfigureAwait(false));
        }
Example #3
0
        public async Task <RegistrationResponse> UpdateRegistrationAsync(string registrationUri, string termsOfServiceUri, string[] contact)
        {
            await EnsureDirectoryAsync().ConfigureAwait(false);

            Info("updating registration: accepting terms of service");

            var registration = new UpdateRegistrationRequest {
                Contact   = contact,
                Agreement = termsOfServiceUri
            };

            return(await PostAsync <RegistrationResponse>(new Uri(registrationUri), registration).ConfigureAwait(false));
        }
        public HttpResponseMessage UpdateRegistration(UpdateRegistrationRequest model)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            //if (RegistrationService.CheckUsername(model.Username))
            //{
            //    string message = "This username is already being used.";
            //    return Request.CreateErrorResponse(HttpStatusCode.BadRequest, message);
            //}

            SuccessResponse response = new SuccessResponse();

            RegistrationService.UpdateRegistration(model);
            return(Request.CreateResponse(response));
        }
Example #5
0
            public async Task <RegistrationResponse> UpdateRegistrationAsync(UpdateRegistrationRequest request, CancellationToken token = default(CancellationToken))
            {
                await EnsureDirectoryAsync().ConfigureAwait(false);

                return(await PostAsync <RegistrationResponse>(new Uri(request.Location), request, token).ConfigureAwait(false));
            }