コード例 #1
0
 EmailContent IEmailContentBuilder.GenerateContent(ITenant tenant)
 {
     return new EmailContent
     {
         MessageBody = this.someService.GenerateContent()
     };
 }
コード例 #2
0
 EmailContent IEmailContentBuilder.GenerateContent(ITenant tenant)
 {
     return new EmailContent
     {
         MessageBody = "This is the default content."
     };
 }
コード例 #3
0
 EmailContent IEmailContentBuilder.GenerateContent(ITenant tenant)
 {
     return new EmailContent
     {
         MessageBody = "This is content for ruby tenant."
     };
 }
コード例 #4
0
        public StyleGuidelineController(ITenant tenant,
                                        ISiteContext siteContext,
                                        IBenefitsModelFactory benefitsModelFactory)
        {
            _tenant                                 = tenant;
            _siteContext                            = siteContext;
            _benefitsModelFactory                   = benefitsModelFactory;

        }
コード例 #5
0
        private IEmailContentBuilder GetTenantSpecificEmailContentBuilder(ITenant tenant)
        {
            var result =
                this.emailContentBuilders
                    .OfType<ITenantOverride>()
                    .Where(t => t.IsForThisTenant(tenant))
                    .OfType<IEmailContentBuilder>()
                    .FirstOrDefault();

            return result;
        }
コード例 #6
0
ファイル: TenantInstance.cs プロジェクト: nicolocodev/saaskit
        public TenantInstance(ITenant tenant)
        {
            if (tenant == null)
            {
                throw new ArgumentNullException("tenant");
            }

            Tenant = tenant;
            Id = Guid.NewGuid();
            Properties = new Dictionary<string, object>();
        }
コード例 #7
0
        IEmailContentBuilder IEmailContentBuilderFactory.GetBuilder(ITenant tenant)
        {
            var result = GetTenantSpecificEmailContentBuilder(tenant);

            if (result == null)
                result = defaultEmailContentBuilder;

            if (result == null)
                result = emailContentBuilders.FirstOrDefault();

            if (result == null)
                throw new ArgumentNullException();

            return result;
        }
        public void SetUp()
        {
            var config = new DocumentStoreTestConfiguration(_engineVersion);
            MongoDbTestConnectionProvider.DropTestsTenant();
            config.SetTestAddress(TestConfig.ServerAddress);
            _documentStoreService = new DocumentStoreBootstrapper();
            _documentStoreService.Start(config);
            _documentStoreClient = new DocumentStoreServiceClient(
                TestConfig.ServerAddress,
                TestConfig.Tenant
            );
            _tenant = ContainerAccessor.Instance.Resolve<TenantManager>().Current;
            _projections = _tenant.Container.Resolve<ITriggerProjectionsUpdate>();
            _documentDescriptorCollection = MongoDbTestConnectionProvider.ReadModelDb.GetCollection<DocumentDescriptorReadModel>("rm.DocumentDescriptor");
            _documentCollection = MongoDbTestConnectionProvider.ReadModelDb.GetCollection<DocumentReadModel>("rm.Document");
            _commitCollection = MongoDbTestConnectionProvider.ReadModelDb.GetCollection<BsonDocument>("Commits");
            _blobStore = _tenant.Container.Resolve<IBlobStore>();

            MongoFlatMapper.EnableFlatMapping(true);
        }
コード例 #9
0
 public int BillingDetails_crud(ITenant _tenant, BillingDetails BillingDetails)
 {
     _tenantlist = _tenant;
     return(_tenantlist.BillingDetails_crud(BillingDetails));
 }
コード例 #10
0
 public int InsertPlanFeature(ITenant _tenant, string PlanName, string FeatureID, int UserMasterID, int TenantId)
 {
     _tenantlist = _tenant;
     return(_tenantlist.InsertPlanFeature(PlanName, FeatureID, UserMasterID, TenantId));
 }
コード例 #11
0
 public TenantResolver(ITenant <TenantReadModel> tenant)
 {
     _tenant = tenant;
 }
コード例 #12
0
 public SlidersController(ITenant <AppTenant> tenant, ApplicationDbContext context) : base(context, tenant)
 {
 }
コード例 #13
0
 public TenantJobsInstaller(ITenant tenant)
 {
     _tenant = tenant;
 }
コード例 #14
0
ファイル: HotColdCoordinator.cs プロジェクト: solyutor/marten
 public HotColdCoordinator(IDocumentStore store, DaemonSettings settings, ILogger logger)
 {
     _settings = settings;
     _logger   = logger;
     _tenant   = store.As <DocumentStore>().Tenancy.Default;
 }
コード例 #15
0
ファイル: TenantPrincipal.cs プロジェクト: jmptrader/griffin
 public TenantPrincipal(ITenant tenant, TenantIdentity identity)
 {
     Tenant = tenant;
     _identity = identity;
 }
コード例 #16
0
 /// <summary>
 /// Adds a new tenant to resolver
 /// </summary>
 /// <param name="tenant">The tenant instance</param>
 public void Add(ITenant tenant)
 {
     Tenants.Add(tenant);
 }
コード例 #17
0
 public abstract NpgsqlCommand BuildLoadManyCommand(TId[] ids, ITenant tenant);
コード例 #18
0
 protected EntityCreateModelBase(ITenant <TenantReadModel> tenant, IMediator mediator, ILoggerFactory loggerFactory)
     : base(tenant, mediator, loggerFactory)
 {
     Entity = new TEntity();
 }
コード例 #19
0
 public TenantCoreInstaller(ITenant tenant)
 {
     _tenant = tenant;
 }
コード例 #20
0
 /// <summary>
 /// Resolves the module of the appropriate application tenant
 /// </summary>
 /// <param name="context">Request context used to select the module</param>
 /// <returns>Module from the appropriate tenant</returns>
 public IContainer Resolve(RequestContext context)
 {
     this.Tenant = this.tenantSelector.Select(context);
     return this.Tenant.DependencyContainer;
 }
コード例 #21
0
ファイル: SaasKitEngine.cs プロジェクト: nicolocodev/saaskit
        private TenantInstance StartInstance(ITenant tenant)
        {
            var instance = new TenantInstance(tenant);
            runningInstances.Add(instance, ShutdownInstance);

            Log("Started instance '{0}'", instance.Id);
            return instance;
        }
コード例 #22
0
 public List <CompanyTypeModel> GetCompanyType(ITenant _tenant)
 {
     _tenantlist = _tenant;
     return(_tenantlist.GetCompanyType());
 }
コード例 #23
0
 public Demo2OnlyController(ITenant tenant)
     : base(tenant)
 {
 }
コード例 #24
0
 public string GetAutoInstallPackagesUiUrl(ITenant tenant, IContainer container, bool forContentApp, int appId)
 {
     return("mvc not implemented #todo #mvc");
 }
コード例 #25
0
 // TODO: Move this to a shared localization class..?
 private bool IsDefaultUICulture(string cultureName, ITenant tenant)
 {
     return tenant.DefaultLocale.Name.Equals(cultureName, StringComparison.InvariantCultureIgnoreCase);
 }
コード例 #26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tenant"></param>
 public HomeController(ITenant tenant)
     : base(tenant)
 {
 }
コード例 #27
0
 public ApplicationUsersController(ApplicationDbContext context, ITenant <AppTenant> tenant, UserManager <ApplicationUser> _userManager)
 {
     this.tenant       = tenant?.Value;
     this._context     = context;
     this._userManager = _userManager;
 }
コード例 #28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tenant"></param>
 public StoreController(ITenant tenant)
     : base(tenant)
 {
 }
コード例 #29
0
ファイル: DocumentCleaner.cs プロジェクト: srasch/marten
 public DocumentCleaner(StoreOptions options, ITenant tenant)
 {
     _options = options;
     _tenant  = tenant;
 }
コード例 #30
0
 public IdAssignment <T> ToIdAssignment <T>(ITenant tenant)
 {
     return(Parent.ToIdAssignment <T>(tenant));
 }
コード例 #31
0
 public TenantConfig(ITenant tenant, IEnumerable <ITenantDataProvider <T> > providers)
 {
     _tenant    = tenant;
     _providers = providers;
 }
コード例 #32
0
        public ProductTagsController(ApplicationDbContext context, ITenant<AppTenant> tenant) : base(context, tenant)
        {

        }
コード例 #33
0
ファイル: TenantSliceGroup.cs プロジェクト: MxLabs/marten
 public TenantSliceGroup(ITenant tenant)
 {
     Tenant = tenant;
     Slices = new LightweightCache <TId, EventSlice <TDoc, TId> >(id => new EventSlice <TDoc, TId>(id, Tenant));
 }
コード例 #34
0
 public RegionsController(ApplicationDbContext context, ITenant <AppTenant> tenant) : base(context, tenant)
 {
 }
コード例 #35
0
 public void EnsureStorageExists(ITenant tenant)
 {
 }
コード例 #36
0
 public int InsertCompany(ITenant _tenant, CompanyModel companyModel)
 {
     _tenantlist = _tenant;
     return(_tenantlist.InsertCompany(companyModel));
 }
コード例 #37
0
 public CommerceSettingsController(ITenant <AppTenant> tenant, ApplicationDbContext context) : base(context, tenant)
 {
 }
コード例 #38
0
 public int OtherDetails(ITenant _tenant, OtherDetailsModel OtherDetails)
 {
     _tenantlist = _tenant;
     return(_tenantlist.OtherDetails(OtherDetails));
 }
コード例 #39
0
 public IStorageOperation Overwrite(IEvent document, IMartenSession session, ITenant tenant)
 {
     throw new NotSupportedException();
 }
コード例 #40
0
 public List <GetPlanDetails> GetPlanDetails(ITenant _tenant, int CustomPlanID, int TenantId)
 {
     _tenantlist = _tenant;
     return(_tenantlist.GetPlanDetails(CustomPlanID, TenantId));
 }
コード例 #41
0
 public void TruncateDocumentStorage(ITenant tenant)
 {
     tenant.RunSql($"truncate table {Events.DatabaseSchemaName}.mt_streams cascade");
 }
コード例 #42
0
 public int AddPlan(ITenant _tenant, TenantPlan _tenantPlan)
 {
     _tenantlist = _tenant;
     return(_tenantlist.AddPlan(_tenantPlan));
 }
コード例 #43
0
 public Task TruncateDocumentStorageAsync(ITenant tenant)
 {
     return(tenant.RunSqlAsync($"truncate table {Events.DatabaseSchemaName}.mt_streams cascade"));
 }
コード例 #44
0
 public TenantHandlersInstaller(ITenant tenant)
 {
     _tenant = tenant;
 }
コード例 #45
0
 public IDeletion DeleteForDocument(IEvent document, ITenant tenant)
 {
     throw new NotSupportedException();
 }
コード例 #46
0
 public TenantAwareController(ITenant tenant)
 {
     this.Model = new BaseViewModel();
     this.Model.Tenant = tenant;
 }
コード例 #47
0
 bool ITenantOverride.IsForThisTenant(ITenant tenant)
 {
     return tenant != null && tenant.TenantId == "ruby";
 }
コード例 #48
0
        private static bool IsRouteDisabled(ITenant tenant, string controller, string action)
        {
            if (tenant.DisabledFeatures != null)
            {
                foreach (IFeature rootFeature in tenant.DisabledFeatures.Features)
                {
                    //Check if feature complex and if the root feature matches the controller
                    if (rootFeature is IComplexFeature && rootFeature.FeatureName.Equals(controller, StringComparison.OrdinalIgnoreCase))
                    {
                        foreach (IFeature subFeature in ((IComplexFeature)rootFeature).SubFeatures)
                        {
                            if (action.Equals(subFeature.FeatureName))
                            {
                                //Subfeature found in disabled list.  Don't route to it.
                                return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
コード例 #49
0
        async Task<ITenant> IClient.GetCurrentTenantAsync(CancellationToken cancellationToken)
        {
            this.tenant = await this.dataStoreAsync
                .GetResourceAsync<ITenant>(this.CurrentTenantHref, cancellationToken)
                .ConfigureAwait(false);

            return this.tenant;
        }
コード例 #50
0
        ITenant IClientSync.GetCurrentTenant()
        {
            this.tenant = this.dataStoreSync.GetResource<ITenant>(this.CurrentTenantHref);

            return this.tenant;
        }
コード例 #51
0
 public DashboardController(ITenant <AppTenant> tenant, ApplicationDbContext context) : base(context, tenant)
 {
 }
コード例 #52
0
ファイル: QuerySession.cs プロジェクト: tamirdresher/marten
        public QuerySession(DocumentStore store, IManagedConnection connection, IQueryParser parser, IIdentityMap identityMap, ITenant tenant)
        {
            Tenant       = tenant;
            _store       = store;
            _connection  = connection;
            _parser      = parser;
            _identityMap = identityMap;

            WriterPool = store.CreateWriterPool();
            Serializer = store.Serializer;
        }
コード例 #53
0
 public void DeleteAllDocuments(ITenant factory)
 {
     factory.RunSql(
         $"delete from {Parent.Table.QualifiedName} where {DocumentMapping.DocumentTypeColumn} = '{Alias}'");
 }
コード例 #54
0
ファイル: DocumentStore.cs プロジェクト: mburleigh/marten
        private static IManagedConnection buildManagedConnection(SessionOptions options, ITenant tenant,
                                                                 CommandRunnerMode commandRunnerMode)
        {
            // Hate crap like this, but if we don't control the transation, use External to direct
            // IManagedConnection not to call commit or rollback
            if (!options.OwnsTransactionLifecycle && commandRunnerMode != CommandRunnerMode.ReadOnly)
            {
                commandRunnerMode = CommandRunnerMode.External;
            }

            if (options.Transaction != null)
            {
                options.Connection = options.Transaction.Connection;
            }


            if (options.Connection == null)
            {
                return(tenant.OpenConnection(commandRunnerMode, options.IsolationLevel, options.Timeout));
            }
            else
            {
                return(new ManagedConnection(options, commandRunnerMode));
            }
        }
コード例 #55
0
ファイル: HomeController.cs プロジェクト: saaskit/saaskit
 public HomeController(ITenant<AppTenant> tenant)
 {
     this.tenant = tenant?.Value;
 }