diff --git a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs index 0aeb97e89d..ba84b32eb1 100644 --- a/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore.MultiTenancy/Volo/Abp/AspNetCore/MultiTenancy/MultiTenancyMiddleware.cs @@ -1,7 +1,15 @@ -using System.Threading.Tasks; +using System; +using System.Globalization; +using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.RequestLocalization; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; +using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; +using Volo.Abp.Settings; namespace Volo.Abp.AspNetCore.MultiTenancy { @@ -23,8 +31,62 @@ namespace Volo.Abp.AspNetCore.MultiTenancy var tenant = await _tenantConfigurationProvider.GetAsync(saveResolveResult: true); using (_currentTenant.Change(tenant?.Id, tenant?.Name)) { + var requestCulture = await TryGetRequestCultureAsync(context); + if (requestCulture != null) + { + CultureInfo.CurrentCulture = requestCulture.Culture; + CultureInfo.CurrentUICulture = requestCulture.UICulture; + AbpRequestCultureCookieHelper.SetCultureCookie( + context, + requestCulture + ); + } + await next(context); } } + + private async Task TryGetRequestCultureAsync(HttpContext httpContext) + { + var requestCultureFeature = httpContext.Features.Get(); + + /* If requestCultureFeature == null, that means the RequestLocalizationMiddleware was not used + * and we don't want to set the culture. */ + if (requestCultureFeature == null) + { + return null; + } + + /* If requestCultureFeature.Provider is not null, that means RequestLocalizationMiddleware + * already picked a language, so we don't need to set the default. */ + if (requestCultureFeature.Provider != null) + { + return null; + } + + var settingProvider = httpContext.RequestServices.GetRequiredService(); + var defaultLanguage = await settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage); + if (defaultLanguage.IsNullOrWhiteSpace()) + { + return null; + } + + string culture; + string uiCulture; + + if (defaultLanguage.Contains(';')) + { + var splitted = defaultLanguage.Split(';'); + culture = splitted[0]; + uiCulture = splitted[1]; + } + else + { + culture = defaultLanguage; + uiCulture = defaultLanguage; + } + + return new RequestCulture(CultureInfo.GetCultureInfo(culture), CultureInfo.GetCultureInfo(uiCulture)); + } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs index 4b4a0e6301..ae013c4343 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/MvcCachedApplicationConfigurationClientHelper.cs @@ -7,7 +7,8 @@ namespace Volo.Abp.AspNetCore.Mvc.Client { public static string CreateCacheKey(ICurrentUser currentUser) { - return $"ApplicationConfiguration_{currentUser.Id?.ToString("N") ?? "Anonymous"}_{CultureInfo.CurrentUICulture.Name}"; + var userKey = currentUser.Id?.ToString("N") ?? "Anonymous"; + return $"ApplicationConfiguration_{userKey}_{CultureInfo.CurrentUICulture.Name}"; } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs index 06b9c9a620..6b73aa26da 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Localization/AbpLanguagesController.cs @@ -1,7 +1,7 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Localization; +using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc; using System; +using Microsoft.AspNetCore.RequestLocalization; using Volo.Abp.Localization; namespace Volo.Abp.AspNetCore.Mvc.Localization @@ -20,12 +20,10 @@ namespace Volo.Abp.AspNetCore.Mvc.Localization throw new AbpException("Unknown language: " + culture + ". It must be a valid culture!"); } - string cookieValue = CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture, uiCulture)); - - Response.Cookies.Append(CookieRequestCultureProvider.DefaultCookieName, cookieValue, new CookieOptions - { - Expires = Clock.Now.AddYears(2) - }); + AbpRequestCultureCookieHelper.SetCultureCookie( + HttpContext, + new RequestCulture(culture, uiCulture) + ); if (!string.IsNullOrWhiteSpace(returnUrl)) { diff --git a/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs new file mode 100644 index 0000000000..0f27925496 --- /dev/null +++ b/framework/src/Volo.Abp.AspNetCore/Microsoft/AspNetCore/RequestLocalization/AbpRequestCultureCookieHelper.cs @@ -0,0 +1,23 @@ +using System; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Localization; + +namespace Microsoft.AspNetCore.RequestLocalization +{ + public static class AbpRequestCultureCookieHelper + { + public static void SetCultureCookie( + HttpContext httpContext, + RequestCulture requestCulture) + { + httpContext.Response.Cookies.Append( + CookieRequestCultureProvider.DefaultCookieName, + CookieRequestCultureProvider.MakeCookieValue(requestCulture), + new CookieOptions + { + Expires = DateTime.Now.AddYears(2) + } + ); + } + } +} diff --git a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/EntityHelper.cs b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/EntityHelper.cs index 5e81e2270d..2f8dd28afc 100644 --- a/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/EntityHelper.cs +++ b/framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/EntityHelper.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; -using System.Linq; using System.Linq.Expressions; using System.Reflection; using JetBrains.Annotations; @@ -15,6 +13,17 @@ namespace Volo.Abp.Domain.Entities /// public static class EntityHelper { + public static bool IsMultiTenant() + where TEntity : IEntity + { + return IsMultiTenant(typeof(TEntity)); + } + + public static bool IsMultiTenant(Type type) + { + return typeof(IMultiTenant).IsAssignableFrom(type); + } + public static bool EntityEquals(IEntity entity1, IEntity entity2) { if (entity1 == null || entity2 == null) diff --git a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs index 4ba5457677..055c9c2de9 100644 --- a/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs +++ b/framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/Domain/Repositories/EntityFrameworkCore/EfCoreRepository.cs @@ -13,6 +13,7 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.DependencyInjection; using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore { @@ -21,18 +22,42 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore where TEntity : class, IEntity { [Obsolete("Use GetDbContextAsync() method.")] - protected virtual TDbContext DbContext => _dbContextProvider.GetDbContext(); + protected virtual TDbContext DbContext => GetDbContext(); [Obsolete("Use GetDbContextAsync() method.")] - DbContext IEfCoreRepository.DbContext => DbContext.As(); + DbContext IEfCoreRepository.DbContext => GetDbContext() as DbContext; async Task IEfCoreRepository.GetDbContextAsync() { return await GetDbContextAsync() as DbContext; } + [Obsolete("Use GetDbContextAsync() method.")] + private TDbContext GetDbContext() + { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return _dbContextProvider.GetDbContext(); + } + } + + return _dbContextProvider.GetDbContext(); + } + protected virtual Task GetDbContextAsync() { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return _dbContextProvider.GetDbContextAsync(); + } + } + return _dbContextProvider.GetDbContextAsync(); } diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs index 9142118b97..7e90bd4fe7 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/ApiDescriptionFinder.cs @@ -1,24 +1,38 @@ using System; +using System.Globalization; using System.Linq; using System.Net.Http; +using System.Net.Http.Headers; using System.Reflection; using System.Text.Json; using System.Threading.Tasks; +using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Modeling; +using Volo.Abp.MultiTenancy; using Volo.Abp.Threading; +using Volo.Abp.Tracing; namespace Volo.Abp.Http.Client.DynamicProxying { public class ApiDescriptionFinder : IApiDescriptionFinder, ITransientDependency { public ICancellationTokenProvider CancellationTokenProvider { get; set; } - protected IApiDescriptionCache Cache { get; } - - public ApiDescriptionFinder(IApiDescriptionCache cache) + protected AbpCorrelationIdOptions AbpCorrelationIdOptions { get; } + protected ICorrelationIdProvider CorrelationIdProvider { get; } + protected ICurrentTenant CurrentTenant { get; } + + public ApiDescriptionFinder( + IApiDescriptionCache cache, + IOptions abpCorrelationIdOptions, + ICorrelationIdProvider correlationIdProvider, + ICurrentTenant currentTenant) { Cache = cache; + AbpCorrelationIdOptions = abpCorrelationIdOptions.Value; + CorrelationIdProvider = correlationIdProvider; + CurrentTenant = currentTenant; CancellationTokenProvider = NullCancellationTokenProvider.Instance; } @@ -71,10 +85,19 @@ namespace Volo.Abp.Http.Client.DynamicProxying return await Cache.GetAsync(baseUrl, () => GetApiDescriptionFromServerAsync(client, baseUrl)); } - protected virtual async Task GetApiDescriptionFromServerAsync(HttpClient client, string baseUrl) + protected virtual async Task GetApiDescriptionFromServerAsync( + HttpClient client, + string baseUrl) { - var response = await client.GetAsync( - baseUrl.EnsureEndsWith('/') + "api/abp/api-definition", + var requestMessage = new HttpRequestMessage( + HttpMethod.Get, + baseUrl.EnsureEndsWith('/') + "api/abp/api-definition" + ); + + AddHeaders(requestMessage); + + var response = await client.SendAsync( + requestMessage, CancellationTokenProvider.Token ); @@ -93,6 +116,30 @@ namespace Volo.Abp.Http.Client.DynamicProxying return (ApplicationApiDescriptionModel)result; } + protected virtual void AddHeaders(HttpRequestMessage requestMessage) + { + //CorrelationId + requestMessage.Headers.Add(AbpCorrelationIdOptions.HttpHeaderName, CorrelationIdProvider.Get()); + + //TenantId + if (CurrentTenant.Id.HasValue) + { + //TODO: Use AbpAspNetCoreMultiTenancyOptions to get the key + requestMessage.Headers.Add(TenantResolverConsts.DefaultTenantKey, CurrentTenant.Id.Value.ToString()); + } + + //Culture + //TODO: Is that the way we want? Couldn't send the culture (not ui culture) + var currentCulture = CultureInfo.CurrentUICulture.Name ?? CultureInfo.CurrentCulture.Name; + if (!currentCulture.IsNullOrEmpty()) + { + requestMessage.Headers.AcceptLanguage.Add(new StringWithQualityHeaderValue(currentCulture)); + } + + //X-Requested-With + requestMessage.Headers.Add("X-Requested-With", "XMLHttpRequest"); + } + protected virtual bool TypeMatches(MethodParameterApiDescriptionModel actionParameter, ParameterInfo methodParameter) { return NormalizeTypeName(actionParameter.TypeAsString) == diff --git a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs index dd4a681ba5..136c9e42ef 100644 --- a/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs +++ b/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/DynamicProxying/DynamicHttpProxyInterceptor.cs @@ -138,7 +138,13 @@ namespace Volo.Abp.Http.Client.DynamicProxying var client = HttpClientFactory.Create(clientConfig.RemoteServiceName); - var action = await ApiDescriptionFinder.FindActionAsync(client, remoteServiceConfig.BaseUrl, typeof(TService), invocation.Method); + var action = await ApiDescriptionFinder.FindActionAsync( + client, + remoteServiceConfig.BaseUrl, + typeof(TService), + invocation.Method + ); + var apiVersion = GetApiVersionInfo(action); var url = remoteServiceConfig.BaseUrl.EnsureEndsWith('/') + UrlBuilder.GenerateUrlWithParameters(action, invocation.ArgumentsDictionary, apiVersion); @@ -158,9 +164,11 @@ namespace Volo.Abp.Http.Client.DynamicProxying ) ); - var response = await client.SendAsync(requestMessage, + var response = await client.SendAsync( + requestMessage, HttpCompletionOption.ResponseHeadersRead /*this will buffer only the headers, the content will be used as a stream*/, - GetCancellationToken()); + GetCancellationToken() + ); if (!response.IsSuccessStatusCode) { @@ -198,7 +206,11 @@ namespace Volo.Abp.Http.Client.DynamicProxying return action.SupportedVersions.Last(); //TODO: Ensure to get the latest version! } - protected virtual void AddHeaders(IAbpMethodInvocation invocation, ActionApiDescriptionModel action, HttpRequestMessage requestMessage, ApiVersionInfo apiVersion) + protected virtual void AddHeaders( + IAbpMethodInvocation invocation, + ActionApiDescriptionModel action, + HttpRequestMessage requestMessage, + ApiVersionInfo apiVersion) { //API Version if (!apiVersion.Version.IsNullOrEmpty()) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs index 6894dc90a2..fc520bce81 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/Domain/Repositories/MongoDB/MongoDbRepository.cs @@ -52,10 +52,34 @@ namespace Volo.Abp.Domain.Repositories.MongoDB } [Obsolete("Use GetDbContextAsync method.")] - protected virtual TMongoDbContext DbContext => DbContextProvider.GetDbContext(); + protected virtual TMongoDbContext DbContext => GetDbContext(); + + [Obsolete("Use GetDbContextAsync method.")] + private TMongoDbContext GetDbContext() + { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return DbContextProvider.GetDbContext(); + } + } + + return DbContextProvider.GetDbContext(); + } protected Task GetDbContextAsync(CancellationToken cancellationToken = default) { + // Multi-tenancy unaware entities should always use the host connection string + if (!EntityHelper.IsMultiTenant()) + { + using (CurrentTenant.Change(null)) + { + return DbContextProvider.GetDbContextAsync(GetCancellationToken(cancellationToken)); + } + } + return DbContextProvider.GetDbContextAsync(GetCancellationToken(cancellationToken)); } diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs index d879803677..e49fa3fe55 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/BackgroundJobsDbContext.cs @@ -1,15 +1,17 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public class BackgroundJobsDbContext : AbpDbContext, IBackgroundJobsDbContext { public DbSet BackgroundJobs { get; set; } - public BackgroundJobsDbContext(DbContextOptions options) + public BackgroundJobsDbContext(DbContextOptions options) : base(options) { @@ -22,4 +24,4 @@ namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore builder.ConfigureBackgroundJobs(); } } -} \ No newline at end of file +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs index cc70b6543a..46701b863e 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.EntityFrameworkCore/Volo/Abp/BackgroundJobs/EntityFrameworkCore/IBackgroundJobsDbContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public interface IBackgroundJobsDbContext : IEfCoreDbContext { DbSet BackgroundJobs { get; } } -} \ No newline at end of file +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs index 745903cae7..13a058bc33 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/BackgroundJobsMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public class BackgroundJobsMongoDbContext : AbpMongoDbContext, IBackgroundJobsMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.BackgroundJobs.MongoDB modelBuilder.ConfigureBackgroundJobs(); } } -} \ No newline at end of file +} diff --git a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs index 8e2d11869d..254d22d63c 100644 --- a/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs +++ b/modules/background-jobs/src/Volo.Abp.BackgroundJobs.MongoDB/Volo/Abp/BackgroundJobs/MongoDB/IBackgroundJobsMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.BackgroundJobs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BackgroundJobsDbProperties.ConnectionStringName)] public interface IBackgroundJobsMongoDbContext : IAbpMongoDbContext { diff --git a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs index 4342d9092c..df912b84e5 100644 --- a/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs +++ b/modules/blob-storing-database/src/Volo.Abp.BlobStoring.Database.Domain/Volo/Abp/BlobStoring/Database/DatabaseBlobContainer.cs @@ -5,17 +5,17 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.BlobStoring.Database { - public class DatabaseBlobContainer : AggregateRoot, IMultiTenant //TODO: Rename to BlobContainer + public class DatabaseBlobContainer : AggregateRoot, IMultiTenant { public virtual Guid? TenantId { get; protected set; } public virtual string Name { get; protected set; } - public DatabaseBlobContainer(Guid id, [NotNull] string name, Guid? tenantId = null) + public DatabaseBlobContainer(Guid id, [NotNull] string name, Guid? tenantId = null) : base(id) { Name = Check.NotNullOrWhiteSpace(name, nameof(name), DatabaseContainerConsts.MaxNameLength); TenantId = tenantId; } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs index 4ab71a0222..85c34aa996 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/BloggingDbContext.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -9,6 +10,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public class BloggingDbContext : AbpDbContext, IBloggingDbContext { @@ -23,7 +25,7 @@ namespace Volo.Blogging.EntityFrameworkCore public DbSet PostTags { get; set; } public DbSet Comments { get; set; } - + public BloggingDbContext(DbContextOptions options) : base(options) { @@ -37,4 +39,4 @@ namespace Volo.Blogging.EntityFrameworkCore builder.ConfigureBlogging(); } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs index dcdb6c78e1..ecb7c282d4 100644 --- a/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.EntityFrameworkCore/Volo/Blogging/EntityFrameworkCore/IBloggingDbContext.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -9,6 +10,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public interface IBloggingDbContext : IEfCoreDbContext { @@ -24,4 +26,4 @@ namespace Volo.Blogging.EntityFrameworkCore DbSet Tags { get; set; } } -} \ No newline at end of file +} diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs index fa265b3e67..1f20ff1744 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/BloggingMongoDbContext.cs @@ -1,6 +1,7 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -8,6 +9,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public class BloggingMongoDbContext : AbpMongoDbContext, IBloggingMongoDbContext { diff --git a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs index 8366e87d74..1dbf5eee92 100644 --- a/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs +++ b/modules/blogging/src/Volo.Blogging.MongoDB/Volo/Blogging/MongoDB/IBloggingMongoDbContext.cs @@ -1,6 +1,7 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Blogging.Blogs; using Volo.Blogging.Comments; using Volo.Blogging.Posts; @@ -8,6 +9,7 @@ using Volo.Blogging.Users; namespace Volo.Blogging.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(BloggingDbProperties.ConnectionStringName)] public interface IBloggingMongoDbContext : IAbpMongoDbContext { @@ -22,4 +24,4 @@ namespace Volo.Blogging.MongoDB IMongoCollection Comments { get; } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs index 720cf494d6..48eb93d19e 100644 --- a/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs +++ b/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Projects/Project.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using JetBrains.Annotations; using Volo.Abp; using Volo.Abp.Domain.Entities; diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs index 7c1c635617..911db81a15 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/DocsDbContext.cs @@ -1,11 +1,13 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; using Volo.Docs.Projects; namespace Volo.Docs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public class DocsDbContext: AbpDbContext, IDocsDbContext { @@ -15,7 +17,7 @@ namespace Volo.Docs.EntityFrameworkCore public DbSet DocumentContributors { get; set; } - public DocsDbContext(DbContextOptions options) + public DocsDbContext(DbContextOptions options) : base(options) { diff --git a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs index 6e96604592..8edd1b74a0 100644 --- a/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs +++ b/modules/docs/src/Volo.Docs.EntityFrameworkCore/Volo/Docs/EntityFrameworkCore/IDocsDbContext.cs @@ -1,11 +1,13 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; using Volo.Docs.Projects; namespace Volo.Docs.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public interface IDocsDbContext : IEfCoreDbContext { @@ -15,4 +17,4 @@ namespace Volo.Docs.EntityFrameworkCore DbSet DocumentContributors { get; set; } } -} \ No newline at end of file +} diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs index afc430c945..3bfb5df491 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/DocsMongoDbContext.cs @@ -2,10 +2,12 @@ using Volo.Abp.Data; using Volo.Docs.Projects; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; namespace Volo.Docs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public class DocsMongoDbContext : AbpMongoDbContext, IDocsMongoDbContext { diff --git a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs index 92c86a7c4f..f6b748611c 100644 --- a/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs +++ b/modules/docs/src/Volo.Docs.MongoDB/Volo/Docs/MongoDB/IDocsMongoDbContext.cs @@ -1,11 +1,13 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; using Volo.Docs.Documents; using Volo.Docs.Projects; namespace Volo.Docs.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(DocsDbProperties.ConnectionStringName)] public interface IDocsMongoDbContext : IAbpMongoDbContext { @@ -13,4 +15,4 @@ namespace Volo.Docs.MongoDB IMongoCollection Documents { get; } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs index af027dc9ba..9c47fcc28c 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/FeatureManagementDbContext.cs @@ -1,15 +1,17 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public class FeatureManagementDbContext : AbpDbContext, IFeatureManagementDbContext { public DbSet FeatureValues { get; set; } - public FeatureManagementDbContext(DbContextOptions options) + public FeatureManagementDbContext(DbContextOptions options) : base(options) { @@ -22,4 +24,4 @@ namespace Volo.Abp.FeatureManagement.EntityFrameworkCore builder.ConfigureFeatureManagement(); } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs index 14abbccc5c..5f1f3f19b2 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.EntityFrameworkCore/Volo/Abp/FeatureManagement/EntityFrameworkCore/IFeatureManagementDbContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public interface IFeatureManagementDbContext : IEfCoreDbContext { DbSet FeatureValues { get; set; } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs index e563130d4f..ba87fbabfb 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/FeatureManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public class FeatureManagementMongoDbContext : AbpMongoDbContext, IFeatureManagementMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.FeatureManagement.MongoDB modelBuilder.ConfigureFeatureManagement(); } } -} \ No newline at end of file +} diff --git a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs index 290dfbe950..d826571ba6 100644 --- a/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs +++ b/modules/feature-management/src/Volo.Abp.FeatureManagement.MongoDB/Volo/Abp/FeatureManagement/MongoDB/IFeatureManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.FeatureManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(FeatureManagementDbProperties.ConnectionStringName)] public interface IFeatureManagementMongoDbContext : IAbpMongoDbContext { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs index fea486a163..eca448f732 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/ISettingManagementDbContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public interface ISettingManagementDbContext : IEfCoreDbContext { DbSet Settings { get; set; } } -} \ No newline at end of file +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs index e85bcd21cc..23a9773912 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.EntityFrameworkCore/Volo/Abp/SettingManagement/EntityFrameworkCore/SettingManagementDbContext.cs @@ -1,9 +1,11 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public class SettingManagementDbContext : AbpDbContext, ISettingManagementDbContext { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs index 357ab0bfe3..609e940b63 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/ISettingManagementMongoDbContext.cs @@ -1,12 +1,14 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public interface ISettingManagementMongoDbContext : IAbpMongoDbContext { IMongoCollection Settings { get; } } -} \ No newline at end of file +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs index ada3a8100f..003e1a4b46 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.MongoDB/Volo/Abp/SettingManagement/MongoDB/SettingManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.SettingManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpSettingManagementDbProperties.ConnectionStringName)] public class SettingManagementMongoDbContext : AbpMongoDbContext, ISettingManagementMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.SettingManagement.MongoDB modelBuilder.ConfigureSettingManagement(); } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs index 20eb5128da..0000e2827c 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/ITenantManagementDbContext.cs @@ -1,9 +1,11 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public interface ITenantManagementDbContext : IEfCoreDbContext { @@ -11,4 +13,4 @@ namespace Volo.Abp.TenantManagement.EntityFrameworkCore DbSet TenantConnectionStrings { get; set; } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs index f75dbd0562..8a359dcde8 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.EntityFrameworkCore/Volo/Abp/TenantManagement/EntityFrameworkCore/TenantManagementDbContext.cs @@ -1,9 +1,11 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.EntityFrameworkCore { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public class TenantManagementDbContext : AbpDbContext, ITenantManagementDbContext { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs index d3c3fcbb62..211aabf1d4 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/ITenantManagementMongoDbContext.cs @@ -1,12 +1,14 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public interface ITenantManagementMongoDbContext : IAbpMongoDbContext { IMongoCollection Tenants { get; } } -} \ No newline at end of file +} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs index 56327952d0..f35cdec78a 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.MongoDB/Volo/Abp/TenantManagement/MongoDb/TenantManagementMongoDbContext.cs @@ -1,9 +1,11 @@ using MongoDB.Driver; using Volo.Abp.Data; using Volo.Abp.MongoDB; +using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.MongoDB { + [IgnoreMultiTenancy] [ConnectionStringName(AbpTenantManagementDbProperties.ConnectionStringName)] public class TenantManagementMongoDbContext : AbpMongoDbContext, ITenantManagementMongoDbContext { @@ -16,4 +18,4 @@ namespace Volo.Abp.TenantManagement.MongoDB modelBuilder.ConfigureTenantManagement(); } } -} \ No newline at end of file +}