ADD 达梦数据库适配。

This commit is contained in:
彭俊 2023-05-17 13:41:27 +08:00
parent e8c13b7245
commit 332a8a7508
5 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,4 @@
using Dm;
using Microsoft.Data.SqlClient;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
@ -6,9 +7,6 @@ using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Logging.Debug;
using Microsoft.Extensions.Options;
using MySqlConnector;
using Npgsql;
using System;
@ -649,6 +647,9 @@ namespace WalkingTec.Mvvm.Core
}
});
break;
case DBTypeEnum.DaMeng:
optionsBuilder.UseDm(CSName);
break;
default:
break;
}
@ -787,6 +788,9 @@ namespace WalkingTec.Mvvm.Core
case DBTypeEnum.Oracle:
//rv = new OracleParameter(name, value) { Direction = dir };
break;
case DBTypeEnum.DaMeng:
rv = new DmParameter(name, value) { Direction = dir };
break;
}
return rv;
}

View File

@ -28,7 +28,7 @@ namespace WalkingTec.Mvvm.Core
/// <summary>
/// 数据库类型
/// </summary>
public enum DBTypeEnum { SqlServer, MySql, PgSql, Memory, SQLite, Oracle }
public enum DBTypeEnum { SqlServer, MySql, PgSql, Memory, SQLite, Oracle, DaMeng }
/// <summary>
/// 页面显示方式

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Description>WalkingTec.Mvvm</Description>
@ -42,4 +42,13 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="DmProvider">
<HintPath>Lib\DmProvider.dll</HintPath>
</Reference>
<Reference Include="Microsoft.EntityFrameworkCore.Dm">
<HintPath>Lib\Microsoft.EntityFrameworkCore.Dm.dll</HintPath>
</Reference>
</ItemGroup>
</Project>