mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-26 17:53:30 +08:00
解决项目文件冲突
This commit is contained in:
@@ -5,3 +5,4 @@
|
||||
obj/
|
||||
bin/
|
||||
BenchmarkDotNet.Artifacts/
|
||||
/output
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Savorboard
|
||||
Copyright (c) 2016 ºÎÕòÏ«
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26711.1
|
||||
VisualStudioVersion = 15.0.26730.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ECBD28DE-AFFB-4C9A-8988-6297FA5ADDD5}"
|
||||
EndProject
|
||||
@@ -45,6 +45,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02-Util.Datas", "src\Util.Datas\02-Util.Datas.csproj", "{CD83426E-2BA1-4DB0-94D9-1185C076276F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02-Util.Datas.Tests.Integration", "test\Util.Datas.Tests.Integration\02-Util.Datas.Tests.Integration.csproj", "{411B666F-EDA0-47E0-BB34-3EAF047549A0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -67,6 +69,10 @@ Global
|
||||
{CD83426E-2BA1-4DB0-94D9-1185C076276F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CD83426E-2BA1-4DB0-94D9-1185C076276F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CD83426E-2BA1-4DB0-94D9-1185C076276F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{411B666F-EDA0-47E0-BB34-3EAF047549A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{411B666F-EDA0-47E0-BB34-3EAF047549A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{411B666F-EDA0-47E0-BB34-3EAF047549A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{411B666F-EDA0-47E0-BB34-3EAF047549A0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -79,6 +85,7 @@ Global
|
||||
{626D7994-7EF6-4E83-BCC5-342F307A0230} = {B9DABCEC-64F9-45BA-AB7C-860CA832D62B}
|
||||
{A0CD99F6-C7A8-46E0-A6F1-800A59142877} = {626D7994-7EF6-4E83-BCC5-342F307A0230}
|
||||
{CD83426E-2BA1-4DB0-94D9-1185C076276F} = {3746073A-1C5C-40A7-9D50-CB2A94CA888A}
|
||||
{411B666F-EDA0-47E0-BB34-3EAF047549A0} = {6FA93B2E-A5E5-44CA-9851-52FAA2BF5C57}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {AA6E8E23-8AB6-4AB6-9B31-494CB7CE5E63}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -11,11 +11,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<OutputPath>..\..\bin\performance\release\</OutputPath>
|
||||
<OutputPath>..\..\output\performance\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<OutputPath>..\..\bin\performance\debug\</OutputPath>
|
||||
<OutputPath>..\..\output\performance\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -320,12 +320,14 @@ https://github.com/dotnetcore/util/
|
||||
- 树型实体基类 [已完成]
|
||||
- EF实体映射配置基类 [已发布]
|
||||
- EF工作单元基类 [已发布]
|
||||
- 仓储基类 [已完成]
|
||||
- 仓储基类 [开发中]
|
||||
- 查询对象 [已发布]
|
||||
- 范围查询条件(规约对象) [已发布]
|
||||
- 分页参数 [已发布]
|
||||
- 分页集合 [已发布]
|
||||
- 查询参数 [已发布]
|
||||
- Crud服务 [开发中]
|
||||
- 树型Crud服务 [开发中]
|
||||
|
||||
## 更新列表
|
||||
|
||||
@@ -343,3 +345,4 @@ https://github.com/dotnetcore/util/
|
||||
- 2017年8月6日,更新了分页参数、分页集合、查询参数及相关单元测试。
|
||||
- 2017年8月8日,更新了查询对象及相关单元测试。
|
||||
- 2017年8月9日,更新了EF实体映射配置基类。更新了EF工作单元基类。
|
||||
- 2017年8月10日,更新了数据操作集成测试项目。
|
||||
|
||||
@@ -4,13 +4,18 @@
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<AssemblyName>Util.Datas</AssemblyName>
|
||||
<RootNamespace>Util.Datas</RootNamespace>
|
||||
<OutputPath>..\..\bin\release\netstandard2.0\</OutputPath>
|
||||
<DocumentationFile>..\..\bin\release\netstandard2.0\netstandard2.0\Util.Datas.xml</DocumentationFile>
|
||||
<OutputPath>..\..\output\release\</OutputPath>
|
||||
<DocumentationFile>..\..\output\release\netstandard2.0\Util.Datas.xml</DocumentationFile>
|
||||
<Authors>何镇汐</Authors>
|
||||
<Company>何镇汐</Company>
|
||||
<Copyright>何镇汐</Copyright>
|
||||
<PackageReleaseNotes>Util应用框架以MIT开源发布,可随意使用</PackageReleaseNotes>
|
||||
<Description>Util数据访问组件</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<OutputPath>..\..\bin\release\netstandard2.0\</OutputPath>
|
||||
<DocumentationFile>..\..\bin\release\netstandard2.0\netstandard2.0\Util.Datas.xml</DocumentationFile>
|
||||
<OutputPath>..\..\output\release\</OutputPath>
|
||||
<DocumentationFile>..\..\output\release\netstandard2.0\Util.Datas.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Util.Datas.Abstractions;
|
||||
using Util.Exceptions;
|
||||
|
||||
namespace Util.Datas.Ef.Core {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Util.Datas.Abstractions {
|
||||
namespace Util.Datas {
|
||||
/// <summary>
|
||||
/// 工作单元
|
||||
/// </summary>
|
||||
@@ -17,11 +17,11 @@ namespace Util.Datas.Queries.Criterias {
|
||||
/// <summary>
|
||||
/// 属性表达式
|
||||
/// </summary>
|
||||
private Expression<Func<TEntity, TProperty>> _propertyExpression;
|
||||
private readonly Expression<Func<TEntity, TProperty>> _propertyExpression;
|
||||
/// <summary>
|
||||
/// 表达式生成器
|
||||
/// </summary>
|
||||
private PredicateExpressionBuilder<TEntity> _builder;
|
||||
private readonly PredicateExpressionBuilder<TEntity> _builder;
|
||||
/// <summary>
|
||||
/// 最小值
|
||||
/// </summary>
|
||||
@@ -33,7 +33,7 @@ namespace Util.Datas.Queries.Criterias {
|
||||
/// <summary>
|
||||
/// 包含边界
|
||||
/// </summary>
|
||||
private Boundary _boundary;
|
||||
private readonly Boundary _boundary;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化范围过滤条件
|
||||
@@ -48,10 +48,26 @@ namespace Util.Datas.Queries.Criterias {
|
||||
_min = min;
|
||||
_max = max;
|
||||
_boundary = boundary;
|
||||
if( IsMinGreaterMax( min, max ) ) {
|
||||
_min = max;
|
||||
_max = min;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取查询条件
|
||||
/// </summary>
|
||||
public Expression<Func<TEntity, bool>> GetPredicate() {
|
||||
Adjust( _min, _max );
|
||||
CreateLeftExpression();
|
||||
CreateRightExpression();
|
||||
return _builder.ToLambda();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 当最小值大于最大值时进行校正
|
||||
/// </summary>
|
||||
private void Adjust( TValue? min, TValue? max ) {
|
||||
if( IsMinGreaterMax( min, max ) == false )
|
||||
return;
|
||||
_min = max;
|
||||
_max = min;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -61,15 +77,6 @@ namespace Util.Datas.Queries.Criterias {
|
||||
/// <param name="max">最大值</param>
|
||||
protected abstract bool IsMinGreaterMax( TValue? min, TValue? max );
|
||||
|
||||
/// <summary>
|
||||
/// 获取查询条件
|
||||
/// </summary>
|
||||
public Expression<Func<TEntity, bool>> GetPredicate() {
|
||||
CreateLeftExpression();
|
||||
CreateRightExpression();
|
||||
return _builder.ToLambda();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建左操作数,即 t => t.Property >= Min
|
||||
/// </summary>
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Util.Datas.Queries {
|
||||
/// <summary>
|
||||
/// 排序项列表
|
||||
/// </summary>
|
||||
private List<OrderByItem> _items;
|
||||
private readonly List<OrderByItem> _items;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化排序生成器
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Util.Datas.Queries {
|
||||
/// <summary>
|
||||
/// 排序生成器
|
||||
/// </summary>
|
||||
private OrderByBuilder _orderByBuilder;
|
||||
private readonly OrderByBuilder _orderByBuilder;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化查询对象
|
||||
|
||||
@@ -22,19 +22,19 @@ namespace Util.Domains {
|
||||
/// <summary>
|
||||
/// 属性名
|
||||
/// </summary>
|
||||
public string PropertyName { get;private set; }
|
||||
public string PropertyName { get; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
public string Description { get; private set; }
|
||||
public string Description { get; }
|
||||
/// <summary>
|
||||
/// 旧值
|
||||
/// </summary>
|
||||
public string OldValue { get; private set; }
|
||||
public string OldValue { get; }
|
||||
/// <summary>
|
||||
/// 新值
|
||||
/// </summary>
|
||||
public string NewValue { get; private set; }
|
||||
public string NewValue { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 输出变更信息
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Linq.Expressions;
|
||||
|
||||
namespace Util.Domains.Repositories {
|
||||
/// <summary>
|
||||
/// 查询条件 - 规约对象
|
||||
/// 查询条件
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
public interface ICriteria<TEntity> where TEntity : IAggregateRoot {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace Util.Domains.Repositories {
|
||||
/// <summary>
|
||||
/// 仓储 - 可读
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
public interface IReadableRepository<TEntity> : IReadableRepository<TEntity, Guid> where TEntity : class, IAggregateRoot {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仓储 - 可读
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <typeparam name="TKey">实体标识类型</typeparam>
|
||||
public interface IReadableRepository<TEntity, in TKey> : IReadableRepository<TEntity, TEntity, TKey> where TEntity : class, IAggregateRoot {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仓储 - 可读
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <typeparam name="TPersistObject">持久化对象类型</typeparam>
|
||||
/// <typeparam name="TKey">实体标识类型</typeparam>
|
||||
public interface IReadableRepository<TEntity, TPersistObject, in TKey> where TEntity : class, IAggregateRoot where TPersistObject : class {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace Util.Domains.Repositories {
|
||||
/// <summary>
|
||||
/// 仓储
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
public interface IRepository<TEntity> : IRepository<TEntity, Guid> where TEntity : class, IAggregateRoot {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仓储
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <typeparam name="TKey">实体标识类型</typeparam>
|
||||
public interface IRepository<TEntity, in TKey> : IRepository<TEntity, TEntity, TKey> where TEntity : class, IAggregateRoot {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仓储
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">实体类型</typeparam>
|
||||
/// <typeparam name="TPersistObject">持久化对象类型</typeparam>
|
||||
/// <typeparam name="TKey">实体标识类型</typeparam>
|
||||
public interface IRepository<TEntity, TPersistObject, in TKey> : IReadableRepository<TEntity, TPersistObject, TKey>
|
||||
where TEntity : class, IAggregateRoot
|
||||
where TPersistObject : class {
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace Util.Domains.Repositories {
|
||||
_pageIndex = 1;
|
||||
return _pageIndex;
|
||||
}
|
||||
set { _pageIndex = value; }
|
||||
set => _pageIndex = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Util.Domains.Repositories {
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
public List<T> Data { get;private set; }
|
||||
public List<T> Data { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 索引器
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using Util.Datas.Queries;
|
||||
using Util.Expressions;
|
||||
|
||||
namespace Util.Helpers {
|
||||
/// <summary>
|
||||
|
||||
@@ -21,20 +21,12 @@ namespace Util.Validations {
|
||||
/// <summary>
|
||||
/// 是否有效
|
||||
/// </summary>
|
||||
public bool IsValid {
|
||||
get {
|
||||
return _results.Count == 0;
|
||||
}
|
||||
}
|
||||
public bool IsValid => _results.Count == 0;
|
||||
|
||||
/// <summary>
|
||||
/// 验证结果个数
|
||||
/// </summary>
|
||||
public int Count {
|
||||
get {
|
||||
return _results.Count;
|
||||
}
|
||||
}
|
||||
public int Count => _results.Count;
|
||||
|
||||
/// <summary>
|
||||
/// 添加验证结果
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
<AssemblyName>Util.Datas.Tests.Integration</AssemblyName>
|
||||
|
||||
<RootNamespace>Util.Datas.Tests</RootNamespace>
|
||||
|
||||
<Authors>何镇汐</Authors>
|
||||
|
||||
<Company>何镇汐</Company>
|
||||
|
||||
<Description>数据访问组件集成测试</Description>
|
||||
|
||||
<Copyright>何镇汐</Copyright>
|
||||
|
||||
<PackageReleaseNotes>Util应用框架以MIT开源发布,可随意使用</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<OutputPath>..\..\output\test</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<OutputPath>..\..\output\test</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170517-02" />
|
||||
<PackageReference Include="xunit" Version="2.2.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Util.Datas\02-Util.Datas.csproj" />
|
||||
<ProjectReference Include="..\..\src\Util\01-Util.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="SqlServer\Repositories\" />
|
||||
<Folder Include="SqlServer\Scripts\Pd\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace Util.Datas.Tests.Samples {
|
||||
/// <summary>
|
||||
/// 订单 - Guid标识
|
||||
/// </summary>
|
||||
public class Order : Util.Domains.AggregateRoot<Order> {
|
||||
/// <summary>
|
||||
/// 初始化订单
|
||||
/// </summary>
|
||||
public Order() : this( Guid.Empty ) {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化订单
|
||||
/// </summary>
|
||||
/// <param name="id">标识</param>
|
||||
public Order( Guid id ) : base( id ) {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订单编码
|
||||
/// </summary>
|
||||
public string Code { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Util.Datas.Tests.Samples;
|
||||
|
||||
namespace Util.Datas.Tests.SqlServer.Mappings {
|
||||
/// <summary>
|
||||
/// 订单映射 - SqlServer
|
||||
/// </summary>
|
||||
public class OrderMap : Util.Datas.Ef.SqlServer.AggregateRootMapBase<Order> {
|
||||
/// <summary>
|
||||
/// 映射表
|
||||
/// </summary>
|
||||
protected override void MapTable( EntityTypeBuilder<Order> builder ) {
|
||||
builder.ToTable( "Orders", "Sales" );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 映射属性
|
||||
/// </summary>
|
||||
protected override void MapProperties( EntityTypeBuilder<Order> builder ) {
|
||||
base.MapProperties( builder );
|
||||
builder.Property( t => t.Id ).HasColumnName( "OrderId" );
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,111 @@
|
||||
/*========================================================== 1. 创建数据库 ===========================================================*/
|
||||
USE [master]
|
||||
GO
|
||||
|
||||
--删除数据库
|
||||
EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'UtilTest'
|
||||
GO
|
||||
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'UtilTest')
|
||||
Begin
|
||||
DROP DATABASE [UtilTest]
|
||||
End
|
||||
GO
|
||||
|
||||
--创建数据库
|
||||
CREATE DATABASE [UtilTest]
|
||||
GO
|
||||
|
||||
/*========================================================== 2. 创建架构 ===========================================================*/
|
||||
USE [UtilTest]
|
||||
GO
|
||||
|
||||
/* 1. Sales */
|
||||
IF EXISTS (SELECT * FROM sys.schemas WHERE name = N'Sales')
|
||||
DROP SCHEMA [Sales]
|
||||
GO
|
||||
CREATE SCHEMA [Sales] AUTHORIZATION [dbo]
|
||||
GO
|
||||
|
||||
/*========================================================== 3. 创建表 ===========================================================*/
|
||||
|
||||
/*==============================================*/
|
||||
/* Orders */
|
||||
/*============================================*/
|
||||
|
||||
|
||||
if exists (select 1
|
||||
from sysobjects
|
||||
where id = object_id('Sales.Orders')
|
||||
and type = 'U')
|
||||
drop table Sales.Orders
|
||||
go
|
||||
|
||||
create table Sales.Orders (
|
||||
OrderId uniqueidentifier not null,
|
||||
Code nvarchar(30) not null,
|
||||
Version timestamp null,
|
||||
constraint PK_ORDERS primary key (OrderId)
|
||||
)
|
||||
go
|
||||
|
||||
if exists (select 1 from sys.extended_properties
|
||||
where major_id = object_id('Sales.Orders') and minor_id = 0)
|
||||
begin
|
||||
execute sp_dropextendedproperty 'MS_Description',
|
||||
'schema', 'Sales', 'table', 'Orders'
|
||||
|
||||
end
|
||||
|
||||
|
||||
execute sp_addextendedproperty 'MS_Description',
|
||||
'订单',
|
||||
'schema', 'Sales', 'table', 'Orders'
|
||||
go
|
||||
|
||||
if exists(select 1 from sys.extended_properties p where
|
||||
p.major_id = object_id('Sales.Orders')
|
||||
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OrderId')
|
||||
)
|
||||
begin
|
||||
execute sp_dropextendedproperty 'MS_Description',
|
||||
'schema', 'Sales', 'table', 'Orders', 'column', 'OrderId'
|
||||
|
||||
end
|
||||
|
||||
|
||||
execute sp_addextendedproperty 'MS_Description',
|
||||
'订单编号',
|
||||
'schema', 'Sales', 'table', 'Orders', 'column', 'OrderId'
|
||||
go
|
||||
|
||||
if exists(select 1 from sys.extended_properties p where
|
||||
p.major_id = object_id('Sales.Orders')
|
||||
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Code')
|
||||
)
|
||||
begin
|
||||
execute sp_dropextendedproperty 'MS_Description',
|
||||
'schema', 'Sales', 'table', 'Orders', 'column', 'Code'
|
||||
|
||||
end
|
||||
|
||||
|
||||
execute sp_addextendedproperty 'MS_Description',
|
||||
'订单编码',
|
||||
'schema', 'Sales', 'table', 'Orders', 'column', 'Code'
|
||||
go
|
||||
|
||||
if exists(select 1 from sys.extended_properties p where
|
||||
p.major_id = object_id('Sales.Orders')
|
||||
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Version')
|
||||
)
|
||||
begin
|
||||
execute sp_dropextendedproperty 'MS_Description',
|
||||
'schema', 'Sales', 'table', 'Orders', 'column', 'Version'
|
||||
|
||||
end
|
||||
|
||||
|
||||
execute sp_addextendedproperty 'MS_Description',
|
||||
'版本号',
|
||||
'schema', 'Sales', 'table', 'Orders', 'column', 'Version'
|
||||
go
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Util.Datas.Tests.SqlServer.UnitOfWorks {
|
||||
/// <summary>
|
||||
/// SqlServer工作单元
|
||||
/// </summary>
|
||||
public interface ISqlServerUnitOfWork : Util.Datas.IUnitOfWork {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Util.Datas.Tests.SqlServer.UnitOfWorks {
|
||||
/// <summary>
|
||||
/// SqlServer工作单元
|
||||
/// </summary>
|
||||
public class SqlServerUnitOfWork : Util.Datas.Ef.SqlServer.UnitOfWork, ISqlServerUnitOfWork {
|
||||
/// <summary>
|
||||
/// 初始化SqlServer工作单元
|
||||
/// </summary>
|
||||
public SqlServerUnitOfWork() : base( "Server=.\\sql2014;Database=UtilTest;uid=sa;pwd=sa;" ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user