Exemplo n.º 1
0
        public static string ToString(this StatusKeys _key)
        {
            string keyStr = "";

            switch (_key)
            {
            case StatusKeys.RECORDING:
                keyStr = "%RECORDING";
                break;

            case StatusKeys.REPLAY:
                keyStr = "%REPLAY";
                break;

            case StatusKeys.CURRENTSCENE:
                keyStr = "%CURRENTSCENE";
                break;

            case StatusKeys.STREAMING:
                keyStr = "%STREAMING";
                break;

            case StatusKeys.CURRENTPROFILE:
                keyStr = "%CURRENTPROFILE";
                break;

            case StatusKeys.FILENAMEFORMAT:
                keyStr = "%FILENAMEFORMAT";
                break;

            default:
                break;
            }
            return(keyStr);
        }
 public async Task <StatusDto> GetByKeyAsync(StatusKeys key)
 {
     return(await _dbContext.Statuses
            .Where(s => s.Id == (int)key)
            .Select(s => s.AsDto())
            .FirstOrDefaultAsync());
 }
Exemplo n.º 3
0
        public async Task UpsertAsync(StatusKeys key, string value)
        {
            StatusDto dto = new StatusDto {
                Key   = key,
                Value = value,
            };

            await UpsertAsync(dto);
        }
        public async Task <IActionResult> GetStatusByKey(StatusKeys key)
        {
            var response = await _statusService.GetByKeyAsync(key);

            if (response == null)
            {
                return(NotFound());
            }

            return(Ok(response));
        }
Exemplo n.º 5
0
 public async Task <StatusDto> GetByKeyAsync(StatusKeys key)
 {
     return(await Task.Run(() => new StatusDto()));
 }
Exemplo n.º 6
0
 public async Task <StatusDto> GetByKeyAsync(StatusKeys key)
 {
     return(await _statusRepository.GetByKeyAsync(key));
 }