Exemple #1
0
        public async Task <IActionResult> LockResource(
            string company,
            [FromBody, Required] LockResourceCommand lockResourceCommand)
        {
            lockResourceCommand.CompanyId = company;

            var locks = await _mediator.Send(MapLockResourceCommand(lockResourceCommand));

            return(Ok(locks));
        }
Exemple #2
0
        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);
        }