예제 #1
0
        public override async Task <Guid?> GetOrNullAsync(AuditDefinition audit)
        {
            var dbEntity = await AuditFlowRepository
                           .FirstOrDefaultAsync(x =>
                                                x.ProviderName == ProviderName &&
                                                x.AuditName == audit.Name &&
                                                x.Enable);

            return(dbEntity?.Id);
        }
예제 #2
0
        public override async Task <Guid?> GetOrNullAsync(AuditDefinition audit)
        {
            var tenantId = _currentTenant.Id?.ToString();

            var dbEntity = await AuditFlowRepository
                           .FirstOrDefaultAsync(
                x => x.ProviderName == ProviderName &&
                x.AuditName == audit.Name &&
                x.Enable &&
                x.ProviderKey == tenantId
                );

            return(dbEntity?.Id);
        }
예제 #3
0
        protected virtual async Task <Guid?> GetOrNullValueFromProvidersAsync(
            IEnumerable <IAuditValueProvider> providers,
            AuditDefinition audit)
        {
            foreach (var provider in providers)
            {
                var value = await provider.GetOrNullAsync(audit);

                if (value != null)
                {
                    return(value);
                }
            }

            return(null);
        }
        public override async Task <Guid?> GetOrNullAsync(AuditDefinition audit)
        {
            if (_currentShop.Id == null)
            {
                return(null);
            }

            var dbEntity = await AuditFlowRepository
                           .FirstOrDefaultAsync(
                x => x.ProviderName == ProviderName &&
                x.AuditName == audit.Name &&
                x.Enable &&
                x.ProviderKey == _currentShop.Id.ToString()
                );

            return(dbEntity?.Id);
        }
예제 #5
0
 public abstract Task <Guid?> GetOrNullAsync(AuditDefinition audit);