public async Task <IActionResult> Patch([FromBody] IDelta <UpdateCurrentUserAccountCommand> delta) { var userContext = await _userContextService.GetCurrentContextAsync(); var userId = userContext.UserId.Value; return(await _apiResponseHelper.RunCommandAsync(this, userId, delta)); }
public Task <JsonResult> Post(AddDocumentAssetCommand command, IFormFile file) { if (file != null) { command.File = new FormFileSource(file); } return(_apiResponseHelper.RunCommandAsync(command)); }
public Task <IActionResult> Like(int PlayerId) { var command = new SetPlayerLikedCommand() { PlayerId = PlayerId, IsLiked = true }; return(_apiResponseHelper.RunCommandAsync(this, command)); }
public Task <IActionResult> Like(int catId) { var command = new SetCatLikedCommand() { CatId = catId, IsLiked = true }; // IApiResponseHelper will validate the command and permissions before executing it // and return any validation errors in a formatted data object return(_apiResponseHelper.RunCommandAsync(this, command)); }
public async Task <JsonResult> Post([FromQuery] int id) { var cancelCommand = new CancelBookingCommand { Id = id }; return(await ApiResponseHelper.RunCommandAsync(cancelCommand)); }
public async Task <JsonResult> Post([FromQuery] int id) { var approveCommand = new ApproveBookingCommand { Id = id }; return(await ApiResponseHelper.RunCommandAsync(approveCommand)); }
public async Task <JsonResult> Post([FromQuery] int id) { var sendWelcomeLetterCommand = new SendWelcomeLetterCommand { Id = id }; return(await ApiResponseHelper.RunCommandAsync(sendWelcomeLetterCommand)); }
public async Task <IHttpActionResult> Post(AddUserCommand command) { if (command.UserAreaCode == CofoundryAdminUserArea.AreaCode) { // TODO: We have a separate command here for adding Cofoundry Admin users, but we could re-use the same one // and separate the notification part out of the handler and make it a separate function in the admin panel. var userCommand = new AddCofoundryUserCommand(); userCommand.Email = command.Email; userCommand.FirstName = command.FirstName; userCommand.LastName = command.LastName; userCommand.RoleId = command.RoleId; return(await _apiResponseHelper.RunCommandAsync(this, userCommand)); } else { return(await _apiResponseHelper.RunCommandAsync(this, command)); } }
public Task <JsonResult> Post([FromBody] SetupCofoundryCommandDto dto) { var command = new SetupCofoundryCommand() { ApplicationName = dto.ApplicationName, Email = dto.Email, DisplayName = dto.DisplayName, Password = dto.Password }; return(_apiResponseHelper.RunCommandAsync(command)); }
public async Task <IActionResult> Post([FromBody] SetupCofoundryCommandDto dto) { var command = new SetupCofoundryCommand() { ApplicationName = dto.ApplicationName, UserEmail = dto.UserEmail, UserFirstName = dto.UserFirstName, UserLastName = dto.UserLastName, UserPassword = dto.UserPassword }; return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public async Task <JsonResult> Post([FromBody] AddUserCommand command) { var userArea = _userAreaDefinitionRepository.GetRequiredByCode(command.UserAreaCode); if (userArea.AllowPasswordSignIn) { return(await _apiResponseHelper.RunCommandAsync(new AddUserWithTemporaryPasswordCommand() { Email = command.Email, FirstName = command.FirstName, LastName = command.LastName, RoleCode = command.RoleCode, RoleId = command.RoleId, UserAreaCode = command.UserAreaCode, Username = command.Username, DisplayName = command.DisplayName })); } return(await _apiResponseHelper.RunCommandAsync(command)); }
public async Task <IActionResult> Post([FromBody] AddPageDirectoryCommand command) { return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public async Task <JsonResult> Patch([FromBody] IDelta <UpdateCurrentUserCommand> delta) { return(await _apiResponseHelper.RunCommandAsync(delta)); }
public Task <IActionResult> Register([FromBody] RegisterMemberAndLogInCommand command) { return(_apiResponseHelper.RunCommandAsync(this, command)); }
public async Task <IHttpActionResult> Post([ModelBinder(typeof(PageVersionModuleDataModelCommandModelBinder))] AddPageVersionModuleCommand command) { return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public async Task <IActionResult> Post(AddDocumentAssetCommand command, IFormFile file) { command.File = _formFileUploadedFileFactory.Create(file); return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public Task <JsonResult> Post(AddImageAssetCommand command, IFormFile file) { command.File = _formFileUploadedFileFactory.Create(file); return(_apiResponseHelper.RunCommandAsync(command)); }
public async Task <IActionResult> Post([FromBody] AddCustomEntityDraftVersionCommand command) { return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public async Task <IActionResult> PatchGeneralSiteSettings([FromBody] IDelta <UpdateGeneralSiteSettingsCommand> delta) { return(await _apiResponseHelper.RunCommandAsync(this, delta)); }
public async Task <IHttpActionResult> Patch(Delta <UpdateCurrentUserAccountCommand> delta) { var userId = _userContextService.GetCurrentContext().UserId.Value; return(await _apiResponseHelper.RunCommandAsync(this, userId, delta)); }
public async Task <IHttpActionResult> Post(AddWebDirectoryCommand command) { return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public Task <JsonResult> Post([ModelBinder(BinderType = typeof(CustomEntityDataModelCommandModelBinder))] AddCustomEntityCommand command) { return(_apiResponseHelper.RunCommandAsync(command)); }
public async Task <IHttpActionResult> Post(AddPageDraftVersionCommand command) { return(await _apiResponseHelper.RunCommandAsync(this, command)); }
public Task <JsonResult> Post([ModelBinder(BinderType = typeof(PageVersionBlockDataModelCommandModelBinder))] AddPageVersionBlockCommand command) { return(_apiResponseHelper.RunCommandAsync(command)); }
public async Task <JsonResult> Post([FromQuery] int id, [FromBody] CheckoutBookingCommand command) { command.Id = id; return(await ApiResponseHelper.RunCommandAsync(command)); }
public Task <JsonResult> Patch(int pageId, [FromBody] IDelta <UpdatePageAccessRuleSetCommand> delta) { return(_apiResponseHelper.RunCommandAsync(pageId, delta)); }
public Task <JsonResult> Post([FromBody] BookingRequestCommand command) { return(ApiResponseHelper.RunCommandAsync(command)); }
public async Task <JsonResult> Register([FromBody] RegisterMemberAndLogInCommand command) { return(await _apiResponseHelper.RunCommandAsync(command)); }
public Task <JsonResult> Post([FromBody] AddPageDirectoryCommand command) { return(_apiResponseHelper.RunCommandAsync(command)); }
public Task <JsonResult> Post([FromBody] AddCustomEntityDraftVersionCommand command) { return(_apiResponseHelper.RunCommandAsync(command)); }