mirror of https://github.com/abpframework/abp.git
67 changed files with 353 additions and 373 deletions
@ -1,26 +1,33 @@ |
|||||
// using JetBrains.Annotations;
|
using JetBrains.Annotations; |
||||
// using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore; |
||||
// using System;
|
using System; |
||||
// using Oracle.EntityFrameworkCore.Infrastructure;
|
using Oracle.EntityFrameworkCore.Infrastructure; |
||||
// using Volo.Abp.EntityFrameworkCore.DependencyInjection;
|
using Volo.Abp.EntityFrameworkCore.DependencyInjection; |
||||
//
|
|
||||
// namespace Volo.Abp.EntityFrameworkCore
|
namespace Volo.Abp.EntityFrameworkCore |
||||
// {
|
{ |
||||
// public static class AbpDbContextConfigurationContextOracleExtensions
|
public static class AbpDbContextConfigurationContextOracleExtensions |
||||
// {
|
{ |
||||
// public static DbContextOptionsBuilder UseOracle(
|
public static DbContextOptionsBuilder UseOracle( |
||||
// [NotNull] this AbpDbContextConfigurationContext context,
|
[NotNull] this AbpDbContextConfigurationContext context, |
||||
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
|
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
||||
// {
|
{ |
||||
// TODO: UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
|
if (context.ExistingConnection != null) |
||||
// if (context.ExistingConnection != null)
|
{ |
||||
// {
|
return context.DbContextOptions.UseOracle(context.ExistingConnection, optionsBuilder => |
||||
// return context.DbContextOptions.UseOracle(context.ExistingConnection, oracleOptionsAction);
|
{ |
||||
// }
|
optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); |
||||
// else
|
oracleOptionsAction?.Invoke(optionsBuilder); |
||||
// {
|
}); |
||||
// return context.DbContextOptions.UseOracle(context.ConnectionString, oracleOptionsAction);
|
} |
||||
// }
|
else |
||||
// }
|
{ |
||||
// }
|
return context.DbContextOptions.UseOracle(context.ConnectionString, optionsBuilder => |
||||
// }
|
{ |
||||
|
optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery); |
||||
|
oracleOptionsAction?.Invoke(optionsBuilder); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|||||
@ -1,30 +1,30 @@ |
|||||
// using JetBrains.Annotations;
|
using JetBrains.Annotations; |
||||
// using System;
|
using System; |
||||
// using Oracle.EntityFrameworkCore.Infrastructure;
|
using Oracle.EntityFrameworkCore.Infrastructure; |
||||
//
|
|
||||
// namespace Volo.Abp.EntityFrameworkCore
|
namespace Volo.Abp.EntityFrameworkCore |
||||
// {
|
{ |
||||
// public static class AbpDbContextOptionsOracleExtensions
|
public static class AbpDbContextOptionsOracleExtensions |
||||
// {
|
{ |
||||
// public static void UseOracle(
|
public static void UseOracle( |
||||
// [NotNull] this AbpDbContextOptions options,
|
[NotNull] this AbpDbContextOptions options, |
||||
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
|
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
||||
// {
|
{ |
||||
// options.Configure(context =>
|
options.Configure(context => |
||||
// {
|
{ |
||||
// context.UseOracle(oracleOptionsAction);
|
context.UseOracle(oracleOptionsAction); |
||||
// });
|
}); |
||||
// }
|
} |
||||
//
|
|
||||
// public static void UseOracle<TDbContext>(
|
public static void UseOracle<TDbContext>( |
||||
// [NotNull] this AbpDbContextOptions options,
|
[NotNull] this AbpDbContextOptions options, |
||||
// [CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null)
|
[CanBeNull] Action<OracleDbContextOptionsBuilder> oracleOptionsAction = null) |
||||
// where TDbContext : AbpDbContext<TDbContext>
|
where TDbContext : AbpDbContext<TDbContext> |
||||
// {
|
{ |
||||
// options.Configure<TDbContext>(context =>
|
options.Configure<TDbContext>(context => |
||||
// {
|
{ |
||||
// context.UseOracle(oracleOptionsAction);
|
context.UseOracle(oracleOptionsAction); |
||||
// });
|
}); |
||||
// }
|
} |
||||
// }
|
} |
||||
// }
|
} |
||||
|
|||||
@ -1,22 +1,20 @@ |
|||||
// using Volo.Abp.Guids;
|
using Volo.Abp.Guids; |
||||
// using Volo.Abp.Modularity;
|
using Volo.Abp.Modularity; |
||||
//
|
|
||||
// namespace Volo.Abp.EntityFrameworkCore.Oracle
|
namespace Volo.Abp.EntityFrameworkCore.Oracle |
||||
// {
|
{ |
||||
// [DependsOn(
|
[DependsOn(typeof(AbpEntityFrameworkCoreModule))] |
||||
// typeof(AbpEntityFrameworkCoreModule)
|
public class AbpEntityFrameworkCoreOracleModule : AbpModule |
||||
// )]
|
{ |
||||
// public class AbpEntityFrameworkCoreOracleModule : AbpModule
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
// {
|
{ |
||||
// public override void ConfigureServices(ServiceConfigurationContext context)
|
Configure<AbpSequentialGuidGeneratorOptions>(options => |
||||
// {
|
{ |
||||
// Configure<AbpSequentialGuidGeneratorOptions>(options =>
|
if (options.DefaultSequentialGuidType == null) |
||||
// {
|
{ |
||||
// if (options.DefaultSequentialGuidType == null)
|
options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary; |
||||
// {
|
} |
||||
// options.DefaultSequentialGuidType = SequentialGuidType.SequentialAsBinary;
|
}); |
||||
// }
|
} |
||||
// });
|
} |
||||
// }
|
} |
||||
// }
|
|
||||
// }
|
|
||||
|
|||||
@ -1,27 +0,0 @@ |
|||||
using System.Threading.Tasks; |
|
||||
using Volo.CmsKit.Pages; |
|
||||
|
|
||||
namespace Volo.CmsKit.Public.Pages |
|
||||
{ |
|
||||
public class PageAppService : CmsKitPublicAppServiceBase, IPageAppService |
|
||||
{ |
|
||||
protected readonly IPageRepository PageRepository; |
|
||||
|
|
||||
public PageAppService(IPageRepository pageRepository) |
|
||||
{ |
|
||||
PageRepository = pageRepository; |
|
||||
} |
|
||||
|
|
||||
public virtual async Task<PageDto> FindByUrlAsync(string url) |
|
||||
{ |
|
||||
var page = await PageRepository.FindByUrlAsync(url); |
|
||||
|
|
||||
if (page == null) |
|
||||
{ |
|
||||
return null; |
|
||||
} |
|
||||
|
|
||||
return ObjectMapper.Map<Page, PageDto>(page); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,28 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Volo.CmsKit.Pages; |
||||
|
|
||||
|
namespace Volo.CmsKit.Public.Pages |
||||
|
{ |
||||
|
public class PagePublicAppService : CmsKitPublicAppServiceBase, IPagePublicAppService |
||||
|
{ |
||||
|
protected IPageRepository PageRepository { get; } |
||||
|
|
||||
|
public PagePublicAppService(IPageRepository pageRepository) |
||||
|
{ |
||||
|
PageRepository = pageRepository; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<PageDto> FindByUrlAsync(string url) |
||||
|
{ |
||||
|
PageDto pageDto = null; |
||||
|
var page = await PageRepository.FindByUrlAsync(url); |
||||
|
|
||||
|
if (page !=null) |
||||
|
{ |
||||
|
pageDto = ObjectMapper.Map<Page, PageDto>(page); |
||||
|
} |
||||
|
|
||||
|
return pageDto; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue