public async Task <IActionResult> LockResource( string company, [FromBody, Required] LockResourceCommand lockResourceCommand) { lockResourceCommand.CompanyId = company; var locks = await _mediator.Send(MapLockResourceCommand(lockResourceCommand)); return(Ok(locks)); }
private static LockResourceCommand MapLockResourceCommand(LockResourceCommand lockResourceCommand) { LockResourceCommand command = ResourceTypeLockCommandDictionary[lockResourceCommand.ResourceType]; command.CompanyId = lockResourceCommand.CompanyId; command.ApplicationSessionId = lockResourceCommand.ApplicationSessionId; command.FunctionalContext = lockResourceCommand.FunctionalContext; command.ResourceCode = lockResourceCommand.ResourceCode; command.ResourceId = lockResourceCommand.ResourceId; command.ResourceType = lockResourceCommand.ResourceType; return(command); }