abp连接oracle
ABP是一个优秀的ASP.NET Boilerplate Web应用框架,近年来得到了越来越多的关注。在进行ABP开发时,不可避免地需要涉及数据库操作,其中Oracle是常用的一种数据库类型。那么在ABP框架中,如何连接Oracle数据库呢?下面就让我们一起深入了解一下。
在进行ABP开发时,连接Oracle数据库有多种方式,比如使用Oracle.DataAccess、Oracle.ManagedDataAccess、System.Data.OracleClient、Devart.Data.Oracle等等。本文以Oracle.DataAccess为例,进行具体介绍。
protected override void PreInitialize() { Configuration.Modules.AbpAutoMapper().Configurators.Add( // 关于AutoMapper的映射配置,可自行百度 ); Configuration.DefaultNameOrConnectionString = "Oracle"; Configuration.BackgroundJobs.IsJobExecutionEnabled = false; } public override void Initialize() { IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); DapperExtensions.DapperExtensions.SetMappingAssemblies(new[] { typeof(EventSourceMySqlEntityMapper).Assembly, typeof(EventSourceSqlEntityMapper).Assembly, typeof(EventSourceOracleEntityMapper).Assembly }); DapperExtensions.DapperExtensions.DefaultMapper = typeof(AbpDapperMapper); }