!6 ADD 达梦数据库适配。

Merge pull request !6 from Peng Sir/master
This commit is contained in:
Sam 2023-05-18 04:35:13 +00:00 committed by Gitee
commit e2af6d57b7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 18 additions and 5 deletions

View File

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

View File

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

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Description>WalkingTec.Mvvm</Description> <Description>WalkingTec.Mvvm</Description>
@ -42,4 +42,13 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.2.0" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.2.0" />
</ItemGroup> </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> </Project>