Exemplo n.º 1
0
        public async Task <PermissionConfigDto> GetAsync(string id)
        {
            var document = await _dataContext.GetDocumentAsync <PermissionConfig>(id);

            var dto = new PermissionConfigDto
            {
                Id            = document.Id,
                GroupId       = document.GroupId,
                Role          = document.Role,
                IsDeleted     = document.IsDeleted,
                ETag          = document.ETag,
                UpdatedById   = document.UpdatedById,
                UpdatedByName = document.UpdatedByName,
                UpdatedOnUtc  = document.UpdatedOnUtc,
                Permissions   = document.Permissions
            };

            return(dto);
        }
Exemplo n.º 2
0
        public async Task <LookupDto> GetAsync(string id)
        {
            var lookup = await _dataContext.GetDocumentAsync <Lookup>(id);

            if (lookup == null)
            {
                return(null);
            }

            var dto = new LookupDto
            {
                Id            = lookup.Id,
                IsDeleted     = lookup.IsDeleted,
                Culture       = lookup.Culture,
                GroupId       = lookup.GroupId,
                Key           = lookup.Key,
                IncludeInPod  = lookup.IncludeInPod,
                Section       = lookup.Section,
                Priority      = lookup.Priority,
                UpdatedById   = lookup.UpdatedById,
                UpdatedByName = lookup.UpdatedByName,
                UpdatedOnUtc  = lookup.UpdatedOnUtc,
                ETag          = lookup.ETag,
                Items         = lookup.Items?
                                .Select(v => new LookupItemDto
                {
                    Text           = v.Text,
                    Value          = v.Value,
                    Remark         = v.Remark,
                    SortOrder      = v.SortOrder,
                    ChildLookupKey = v.ChildLookupKey
                }).ToList()
            };

            return(dto);
        }
Exemplo n.º 3
0
 private async Task <ConfigurationSetting> GetConfigurationSettingAsync(string id)
 {
     return(await _dataContext.GetDocumentAsync <ConfigurationSetting>(id));
 }
Exemplo n.º 4
0
 private async Task <LocalisationText> GetLocalisationTextAsync(string id)
 {
     return(await _dataContext.GetDocumentAsync <LocalisationText>(id));
 }
Exemplo n.º 5
0
 private async Task <AlertTemplate> GetAlertTemplateAsync(string id)
 {
     return(await _dataContext.GetDocumentAsync <AlertTemplate>(id));
 }