Skip to content

Commit

Permalink
优化模版生成。
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Nov 5, 2014
1 parent c2ea3f2 commit 6b0ff28
Show file tree
Hide file tree
Showing 31 changed files with 447 additions and 89 deletions.
36 changes: 36 additions & 0 deletions UCsoft.Dao/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UCsoft.Dao")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UCsoft.Dao")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("293f7bcd-dfeb-4061-bafc-2849c6a67b81")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
52 changes: 52 additions & 0 deletions UCsoft.Dao/UCsoft.Dao.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A82D0328-3BF9-4798-AF81-1B0510DF316A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UCsoft.Dao</RootNamespace>
<AssemblyName>UCsoft.Dao</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 36 additions & 0 deletions UCsoft.Service/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UCsoft.Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UCsoft.Service")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("35b4cf8f-8c82-4491-931b-6e654794126e")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
52 changes: 52 additions & 0 deletions UCsoft.Service/UCsoft.Service.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{46D66FFD-2EE6-488C-8F9A-7507BF108014}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UCsoft.Service</RootNamespace>
<AssemblyName>UCsoft.Service</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
73 changes: 0 additions & 73 deletions UCsoft.T4/Data/DBContext.cs

This file was deleted.

61 changes: 61 additions & 0 deletions UCsoft.T4/Entity/Entity.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@


using System;
using System.Collections.Generic;
using System.Linq;
using NLite.Data;
using UCsoft.Entity;
using NLite.Reflection;
namespace UCsoft.Data
{
public partial class Entity:DbContext
{
#region 初始化上下文
//连接字符串名称:基于Config文件中连接字符串的配置
const string connectionStringName = "SqlServer";

//构造dbConfiguration 对象
static DbConfiguration dbConfiguration;

static Entity()
{
dbConfiguration = DbConfiguration
.Configure(connectionStringName)
.SetSqlLogger(() =>SqlLog.Debug)
.AddFromAssemblyOf<Entity>(t=>t.HasAttribute<TableAttribute>(false))
;
}

public Entity():base(dbConfiguration){}
#endregion

#region 数据集关联
public IDbSet<TCusBase> TCusBases { get; private set; }
public IDbSet<TCusCon> TCusCons { get; private set; }
public IDbSet<TCusLog> TCusLogs { get; private set; }
public IDbSet<TFunApp> TFunApps { get; private set; }
public IDbSet<TFunAppCompany> TFunAppCompanies { get; private set; }
public IDbSet<TFunExpand> TFunExpands { get; private set; }
public IDbSet<TFunFilter> TFunFilters { get; private set; }
public IDbSet<TFunMyapp> TFunMyapps { get; private set; }
public IDbSet<TFunMyappCompany> TFunMyappCompanies { get; private set; }
public IDbSet<TFunOperating> TFunOperatings { get; private set; }
public IDbSet<TFunTag> TFunTags { get; private set; }
public IDbSet<TSysCompany> TSysCompanies { get; private set; }
public IDbSet<TSysDepartment> TSysDepartments { get; private set; }
public IDbSet<TSysLog> TSysLogs { get; private set; }
public IDbSet<TSysPower> TSysPowers { get; private set; }
public IDbSet<TSysRole> TSysRoles { get; private set; }
public IDbSet<TSysUser> TSysUsers { get; private set; }
public IDbSet<VAppCompany> VAppCompanies { get; private set; }
public IDbSet<VCompanyUser> VCompanyUsers { get; private set; }
public IDbSet<VCustomerContact> VCustomerContacts { get; private set; }
public IDbSet<VMyappCompany> VMyappCompanies { get; private set; }
public IDbSet<VSysDepartment> VSysDepartments { get; private set; }
#endregion
}



}




Loading

0 comments on commit 6b0ff28

Please sign in to comment.