public UserService(UserManager <TUser> userManager, IQueryableProvider <TUser> queryableProvider, ILogger <UserService <TUser, TKey> > logger) { _userManager = userManager; _queryableProvider = queryableProvider; _logger = logger; }
public UserStore( DataStore store, IPasswordHasher <TUser> passwordHasher, RoleManager <TRole> roles, IQueryableProvider <TUser> queryable, IIdentityClaimNameProvider claimNameProvider, ISuperUserInfoProvider superUserInfoProvider, ILookupNormalizer lookupNormalizer, IServiceProvider serviceProvider) { serviceProvider.TryGetRequestAbortCancellationToken(out var cancellationToken); serviceProvider.TryGetTenantId(out _tenantId); serviceProvider.TryGetTenantName(out _tenantName); serviceProvider.TryGetApplicationId(out _applicationId); serviceProvider.TryGetApplicationName(out _applicationName); CancellationToken = cancellationToken; _store = store; _passwordHasher = passwordHasher; _roles = roles; _queryable = queryable; _claimNameProvider = claimNameProvider; _superUserInfoProvider = superUserInfoProvider; _lookupNormalizer = lookupNormalizer; }
public static ICollection <ValidationResult> ExecuteValidation(this IQueryableProvider provider) { var errors = new List <ValidationResult>(); var entries = provider .Context .ChangeTracker .Entries() .Where(x => x.State == Microsoft.EntityFrameworkCore.EntityState.Added || x.State == Microsoft.EntityFrameworkCore.EntityState.Modified) .ToList(); foreach (var entry in entries) { var entity = entry.Entity; var validationProvider = new ValidationServiceProvider(provider); var validationContext = new ValidationContext(entity, validationProvider, null); var entityErrors = new List <ValidationResult>(); if (!Validator.TryValidateObject(entity, validationContext, entityErrors)) { errors.AddRange(entityErrors); } } return(errors); }
public OptionsBuilder( IQueryableProvider queryableProvider, IHttpContextAccessor httpContextAccessor) { _queryableProvider = queryableProvider; _httpContextAccessor = httpContextAccessor; }
public IQueryable <Badge> Execute(IQueryableProvider queryableProvider) { var baseQuery = queryableProvider.Query <Badge>(); if (IncludeApp) { baseQuery = baseQuery.Include(i => i.App); } if (IncludeStage) { baseQuery = baseQuery.Include(i => i.Stage); } if (_id.HasValue) { baseQuery = baseQuery.Where(w => w.Id == _id); } if (_appId.HasValue) { baseQuery = baseQuery.Where(w => w.AppId == _appId && w.StageId == _stageId); } return(baseQuery.AsQueryable()); }
public ICollection <Option> GetOptions(IQueryableProvider provider) => provider .Context .Set <Manager>() .Select(x => new Option { Label = $"{x.FirstName} {x.LastName}", Value = x.Id }) .ToList();
public ICollection <Option> GetOptions(IQueryableProvider provider) => provider .Context .Set <State>() .Select(x => new Option { Label = x.Name, Value = x.Id }) .ToList();
public ICollection <Option> GetOptions(IQueryableProvider provider) => provider .Context .Set <Priority>() .Select(x => new Option { Label = x.PriorityType, Value = x.Id }) .ToList();
public RoleService(RoleManager <TRole> roleManager, ILookupNormalizer lookupNormalizer, IRoleStoreExtended <TRole> roleStore, IQueryableProvider <TRole> queryableProvider) { _roleManager = roleManager; _lookupNormalizer = lookupNormalizer; _roleStore = roleStore; _queryableProvider = queryableProvider; }
public IQueryable <App> Execute(IQueryableProvider queryableProvider) { var baseQuery = queryableProvider .Query <App>() .Where(w => w.OrganisationId == _orgId) .OrderBy(o => o.Name); return(baseQuery.AsQueryable()); }
public IQueryable <Stage> Execute(IQueryableProvider queryableProvider) { var baseQuery = queryableProvider .Query <Stage>() .Where(w => w.OrganisationId == _orgId) .OrderBy(o => o.OrderBy); //defined sort order return(baseQuery.AsQueryable()); }
public IEnumerable <FormField> Handler(string context, string schema) { var properties = _modelLoader.LoadModel <FormAttribute>(context, schema); IQueryableProvider queryableProvider = _contextLoader.Load(context); var formFields = _formFieldsBuilder.BuildFormFieldsBySchemaProperty(properties, queryableProvider); return(formFields); }
public TenantStore( DataStore store, IQueryableProvider <TTenant> queryable, IServiceProvider serviceProvider) { serviceProvider.TryGetRequestAbortCancellationToken(out var cancellationToken); CancellationToken = cancellationToken; _store = store; _queryable = queryable; }
public TenantStore( IDataConnection connection, IQueryableProvider <TTenant> queryable, IServiceProvider serviceProvider) { serviceProvider.TryGetRequestAbortCancellationToken(out var cancellationToken); CancellationToken = cancellationToken; _connection = connection; _queryable = queryable; }
public IQueryable <OrganisationKey> Execute(IQueryableProvider queryableProvider) { var baseQuery = queryableProvider.Query <OrganisationKey>() .Where(w => w.Id == _id); if (_includeOrganisation) { baseQuery = baseQuery.Include(i => i.Organisation); } return(baseQuery.AsQueryable()); }
private void InitializeFormFieldBuilders(IQueryableProvider queryableProvider) { _factoryFormFields = new List <BuildFormField> { new CheckboxBuilder(), new DatePickerBuilder(), new DropDownListBuilder(new OptionsBuilder(queryableProvider, _httpContextAccessor)), new RadioBuilder(new OptionsBuilder(queryableProvider, _httpContextAccessor)), new InputBuilder(), new InputNumberBuilder() }; }
public static ICollection <ValidationResult> SaveChangesWithValidations(this IQueryableProvider provider) { var resultValidation = provider.ExecuteValidation(); if (resultValidation.Any()) { return(resultValidation); } provider.Context.SaveChanges(); return(resultValidation); }
public RoleStore( IQueryableProvider <TRole> queryable, DataStore store, IServiceProvider serviceProvider) { serviceProvider.TryGetRequestAbortCancellationToken(out var cancellationToken); serviceProvider.TryGetTenantId(out _tenantId); serviceProvider.TryGetApplicationId(out _applicationId); CancellationToken = cancellationToken; _queryable = queryable; _store = store; }
public IQueryable <App> Execute(IQueryableProvider queryableProvider) { var baseQuery = queryableProvider.Query <App>(); if (_id.HasValue) { baseQuery = baseQuery.Where(w => w.Id == _id); } if (!string.IsNullOrWhiteSpace(_name)) { baseQuery = baseQuery.Where(w => w.OrganisationId == _orgId && w.Name == _name); } return(baseQuery.AsQueryable()); }
public IQueryable <Organisation> Execute(IQueryableProvider queryableProvider) { DoValidations(); var baseQuery = queryableProvider.Query <Organisation>(); if (_id.HasValue) { baseQuery = baseQuery.Where(w => w.Id == _id); } if (!string.IsNullOrWhiteSpace(_name) & !string.IsNullOrWhiteSpace(_masterEmail)) { baseQuery = baseQuery.Where(w => w.Name == _name && w.MasterEmail == _masterEmail); } return(baseQuery.AsQueryable()); }
public IQueryable <Member> Execute(IQueryableProvider queryableProvider) { //validate query data if (!_organisationId.HasValue && string.IsNullOrWhiteSpace(_email)) { throw new ThisAppException(StatusCodes.Status417ExpectationFailed, Messages.Err417MissingObjectData("Member information")); } var baseQuery = queryableProvider.Query <Member>() .Where(w => w.OrganisationId == _organisationId); if (!string.IsNullOrWhiteSpace(_email)) { baseQuery = baseQuery.Where(w => w.Email == _email); } return(baseQuery.AsQueryable()); }
public IQueryable <Member> Execute(IQueryableProvider queryableProvider) { if (!_id.HasValue && !_orgId.HasValue) { throw new ThisAppException(StatusCodes.Status412PreconditionFailed, Messages.Err417MissingObjectData("")); } var baseQuery = queryableProvider.Query <Member>(); if (_id.HasValue) { baseQuery = baseQuery.Where(w => w.Id == _id.Value); } if (_orgId.HasValue) { baseQuery = baseQuery.Where(w => w.OrganisationId == _orgId.Value && w.Email == _email); } return(baseQuery.AsQueryable()); }
public UserStore(IDataConnection connection, IPasswordHasher <TUser> passwordHasher, RoleManager <TRole> roles, IQueryableProvider <TUser> queryable, IOptions <IdentityOptionsExtended> identity, IOptions <SecurityOptions> security, IServiceProvider serviceProvider) { serviceProvider.TryGetRequestAbortCancellationToken(out var cancellationToken); serviceProvider.TryGetTenantId(out _tenantId); serviceProvider.TryGetTenantName(out _tenantName); CancellationToken = cancellationToken; _connection = connection; _passwordHasher = passwordHasher; _roles = roles; _queryable = queryable; _identity = identity; _security = security; }
public IEnumerable <FormField> BuildFormFieldsBySchemaProperty( IEnumerable <PropertyInfo> properties, IQueryableProvider queryableProvider) { var formFields = new List <FormField>(); InitializeFormFieldBuilders(queryableProvider); foreach (var property in properties) { var formFieldConfig = _factoryFormFields.SingleOrDefault(x => x.CheckFormFieldType(property)); if (formFieldConfig != null) { formFields.Add(formFieldConfig.Build(property)); } else { formFields.Add(_defaultInputBuilder.Build(property)); } } return(formFields); }
public IQueryable <OrganisationKey> Execute(IQueryableProvider queryableProvider) { //validate query data if (!_organisationId.HasValue && _data == null) { throw new ThisAppException(StatusCodes.Status417ExpectationFailed, Messages.Err417MissingObjectData("Private Key information")); } var baseQuery = queryableProvider.Query <OrganisationKey>() .Where(w => w.OrganisationId == _organisationId); if (_data != null) { baseQuery = baseQuery.Where ( w => w.Description == _data.Description && w.ExpiryDate == _data.ExpiryDate && w.PrivateKey == _data.PrivateKey ); } return(baseQuery.AsQueryable()); }
public CastingBuilder(DbContext dbContext, IQueryableProvider queryableProvider, IMapper mapper) { _dbContext = dbContext; _queryableProvider = queryableProvider; _mapper = mapper; }
public ListPersonQueryHandler(IQueryableProvider <Person> provider) { this.provider = provider; }
public UserService(UserManager <TUser> userManager, IQueryableProvider <TUser> queryableProvider) { _userManager = userManager; _queryableProvider = queryableProvider; }
public TenantService(TenantManager <TTenant, TUser, TKey> tenantManager, IQueryableProvider <TTenant> queryableProvider) { _tenantManager = tenantManager; _queryableProvider = queryableProvider; }
public Runner(IActionHandler <Tin, TOut> actionHandler, IQueryableProvider provider) { _actionHandler = actionHandler; _provider = provider; }