public async Task Post([FromBody] RegisterBodyData data) { if (ModelState.IsValid) { var registrationData = data.ToDTO(); var result = await registrationProcess.Register(registrationData); Ok(); } BadRequest(ModelState); }
public static RegisterDTO ToDTO(this RegisterBodyData data) { return(new RegisterDTO { Username = data.Username, Email = data.Email, FullName = data.FullName, Password = data.Password, IsActive = true }); }