Browse Source

Update Demo

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
10d5537a08
  1. 3
      Src/Asp.Net/OracleTest/Demos/DemoBase.cs
  2. 8
      Src/Asp.Net/OracleTest/OracleTest.csproj
  3. 3
      Src/Asp.Net/OracleTest/UnitTest/Mapping .cs
  4. 3
      Src/Asp.Net/OracleTest/UnitTest/Query/JoinQuery.cs
  5. 2
      Src/Asp.Net/OracleTest/UnitTest/Query/SelectQuery.cs
  6. 3
      Src/Asp.Net/OracleTest/app.config

3
Src/Asp.Net/OracleTest/Demos/DemoBase.cs

@ -11,8 +11,7 @@ namespace OrmTest.Demo
public static SqlSugarClient GetInstance()
{
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.Oracle, IsAutoCloseConnection = true });
db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) =>
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it=>it.ParameterName,it=>it.Value)));
Console.WriteLine();

8
Src/Asp.Net/OracleTest/OracleTest.csproj

@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OracleTest</RootNamespace>
<AssemblyName>OracleTest</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -21,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -30,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="SyntacticSugar, Version=2.4.1.0, Culture=neutral, processorArchitecture=MSIL" />
@ -94,6 +97,9 @@
<ItemGroup>
<Folder Include="DataBase\" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

3
Src/Asp.Net/OracleTest/UnitTest/Mapping .cs

@ -57,8 +57,7 @@ namespace OrmTest.UnitTest
public SqlSugarClient GetInstance2()
{
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { InitKeyType = InitKeyType.Attribute, ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) =>
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql + "\r\n" + db.RewritableMethods.SerializeObject(pars));
Console.WriteLine();

3
Src/Asp.Net/OracleTest/UnitTest/Query/JoinQuery.cs

@ -129,8 +129,7 @@ namespace OrmTest.UnitTest
public new SqlSugarClient GetInstance()
{
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) =>
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql + " " + pars);
};

2
Src/Asp.Net/OracleTest/UnitTest/Query/SelectQuery.cs

@ -30,7 +30,7 @@ namespace OrmTest.UnitTest
using (var db = GetInstance())
{
//db.Database.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) =>
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql + " " + pars);
};

3
Src/Asp.Net/OracleTest/app.config

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
Loading…
Cancel
Save