mirror of https://github.com/abpframework/abp.git
20 changed files with 60 additions and 58 deletions
@ -1,10 +1,9 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Entities; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
|
|||
namespace Volo.Abp.Repositories |
|||
namespace Volo.Abp.Domain.Repositories |
|||
{ |
|||
public static class EfCoreRepositoryExtensions |
|||
{ |
|||
@ -1,8 +1,7 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Entities; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Volo.Abp.Repositories.EntityFrameworkCore |
|||
namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore |
|||
{ |
|||
public interface IEfCoreRepository<TEntity, TPrimaryKey> : IQueryableRepository<TEntity, TPrimaryKey> |
|||
where TEntity : class, IEntity<TPrimaryKey> |
|||
@ -1,6 +1,4 @@ |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace Volo.Abp.Repositories.EntityFrameworkCore |
|||
namespace Volo.Abp.EntityFrameworkCore |
|||
{ |
|||
public interface IDbContextProvider<out TDbContext> |
|||
where TDbContext : AbpDbContext<TDbContext> |
|||
@ -0,0 +1,26 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace Volo.Abp.Uow.EntityFrameworkCore |
|||
{ |
|||
public class DbContextDatabaseApi<TDbContext> : IDatabaseApi |
|||
where TDbContext : AbpDbContext<TDbContext> |
|||
{ |
|||
public TDbContext DbContext { get; } |
|||
|
|||
public DbContextDatabaseApi(TDbContext dbContext) |
|||
{ |
|||
DbContext = dbContext; |
|||
} |
|||
|
|||
public Task SaveChangesAsync() |
|||
{ |
|||
return DbContext.SaveChangesAsync(); |
|||
} |
|||
|
|||
public Task CommitAsync() |
|||
{ |
|||
return DbContext.SaveChangesAsync(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,11 +1,13 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.MultiTenancy |
|||
{ |
|||
public interface IMultiTenancyManager |
|||
{ |
|||
[CanBeNull] |
|||
TenantInfo CurrentTenant { get; } |
|||
|
|||
IDisposable ChangeTenant(TenantInfo tenantInfo); |
|||
IDisposable ChangeTenant([CanBeNull] TenantInfo tenant); |
|||
} |
|||
} |
|||
@ -1,9 +1,11 @@ |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.MultiTenancy |
|||
{ |
|||
public interface ICurrentTenantResolveContext : IServiceProviderAccessor |
|||
public interface ITenantResolveContext : IServiceProviderAccessor |
|||
{ |
|||
[CanBeNull] |
|||
TenantInfo Tenant { get; set; } |
|||
|
|||
bool? Handled { get; set; } |
|||
@ -1,9 +1,11 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.DependencyInjection |
|||
{ |
|||
public interface IServiceProviderAccessor //TODO: Move to Volo.DependencyInjection package?
|
|||
{ |
|||
[NotNull] |
|||
IServiceProvider ServiceProvider { get; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue