初始化项目
This commit is contained in:
43
AUTS.Domain/Entities/InHaosEntity.Context.cs
Normal file
43
AUTS.Domain/Entities/InHaosEntity.Context.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
|
||||
public partial class Uts_InHaosEntities : DbContext
|
||||
{
|
||||
public Uts_InHaosEntities()
|
||||
: base("name=Uts_InHaosEntities")
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
throw new UnintentionalCodeFirstException();
|
||||
}
|
||||
|
||||
public virtual DbSet<TBL_FlowCtr> TBL_FlowCtr { get; set; }
|
||||
public virtual DbSet<TBL_Log> TBL_Log { get; set; }
|
||||
public virtual DbSet<TBL_ProductionLine> TBL_ProductionLine { get; set; }
|
||||
public virtual DbSet<TBL_SyncList> TBL_SyncList { get; set; }
|
||||
public virtual DbSet<TBL_ProductionPlan> TBL_ProductionPlan { get; set; }
|
||||
public virtual DbSet<TBL_SnRules> TBL_SnRules { get; set; }
|
||||
public virtual DbSet<TBL_SnList> TBL_SnList { get; set; }
|
||||
public virtual DbSet<TBL_ProductTypes> TBL_ProductTypes { get; set; }
|
||||
public virtual DbSet<TBL_Customer> TBL_Customer { get; set; }
|
||||
public virtual DbSet<TBL_Project> TBL_Project { get; set; }
|
||||
public virtual DbSet<TBL_StationList> TBL_StationList { get; set; }
|
||||
public virtual DbSet<TBL_OrderInternal> TBL_OrderInternal { get; set; }
|
||||
public virtual DbSet<TBL_Orders> TBL_Orders { get; set; }
|
||||
public virtual DbSet<TBL_RepairRequest> TBL_RepairRequestSet { get; set; }
|
||||
}
|
||||
}
|
||||
636
AUTS.Domain/Entities/InHaosEntity.Context.tt
Normal file
636
AUTS.Domain/Entities/InHaosEntity.Context.tt
Normal file
@@ -0,0 +1,636 @@
|
||||
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||
output extension=".cs"#><#
|
||||
|
||||
const string inputFile = @"InHaosEntity.edmx";
|
||||
var textTransform = DynamicTextTransformation.Create(this);
|
||||
var code = new CodeGenerationTools(this);
|
||||
var ef = new MetadataTools(this);
|
||||
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
|
||||
var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors);
|
||||
var itemCollection = loader.CreateEdmItemCollection(inputFile);
|
||||
var modelNamespace = loader.GetModelNamespace(inputFile);
|
||||
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
|
||||
|
||||
var container = itemCollection.OfType<EntityContainer>().FirstOrDefault();
|
||||
if (container == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
#>
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
|
||||
//
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
<#
|
||||
|
||||
var codeNamespace = code.VsNamespaceSuggestion();
|
||||
if (!String.IsNullOrEmpty(codeNamespace))
|
||||
{
|
||||
#>
|
||||
namespace <#=code.EscapeNamespace(codeNamespace)#>
|
||||
{
|
||||
<#
|
||||
PushIndent(" ");
|
||||
}
|
||||
|
||||
#>
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
<#
|
||||
if (container.FunctionImports.Any())
|
||||
{
|
||||
#>
|
||||
using System.Data.Entity.Core.Objects;
|
||||
using System.Linq;
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
|
||||
{
|
||||
public <#=code.Escape(container)#>()
|
||||
: base("name=<#=container.Name#>")
|
||||
{
|
||||
<#
|
||||
if (!loader.IsLazyLoadingEnabled(container))
|
||||
{
|
||||
#>
|
||||
this.Configuration.LazyLoadingEnabled = false;
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
|
||||
{
|
||||
// Note: the DbSet members are defined below such that the getter and
|
||||
// setter always have the same accessibility as the DbSet definition
|
||||
if (Accessibility.ForReadOnlyProperty(entitySet) != "public")
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.DbSetInitializer(entitySet)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
throw new UnintentionalCodeFirstException();
|
||||
}
|
||||
|
||||
<#
|
||||
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.DbSet(entitySet)#>
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var edmFunction in container.FunctionImports)
|
||||
{
|
||||
WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false);
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
|
||||
if (!String.IsNullOrEmpty(codeNamespace))
|
||||
{
|
||||
PopIndent();
|
||||
#>
|
||||
}
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#+
|
||||
|
||||
private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
if (typeMapper.IsComposable(edmFunction))
|
||||
{
|
||||
#>
|
||||
|
||||
[DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")]
|
||||
<#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
|
||||
{
|
||||
<#+
|
||||
codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
|
||||
#>
|
||||
<#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
|
||||
}
|
||||
<#+
|
||||
}
|
||||
else
|
||||
{
|
||||
#>
|
||||
|
||||
<#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
|
||||
{
|
||||
<#+
|
||||
codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
|
||||
#>
|
||||
<#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
|
||||
}
|
||||
<#+
|
||||
if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption))
|
||||
{
|
||||
WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit)
|
||||
{
|
||||
#>
|
||||
var <#=name#> = <#=isNotNull#> ?
|
||||
<#=notNullInit#> :
|
||||
<#=nullInit#>;
|
||||
|
||||
<#+
|
||||
}
|
||||
|
||||
public const string TemplateId = "CSharp_DbContext_Context_EF6";
|
||||
|
||||
public class CodeStringGenerator
|
||||
{
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly TypeMapper _typeMapper;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(typeMapper, "typeMapper");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
|
||||
_code = code;
|
||||
_typeMapper = typeMapper;
|
||||
_ef = ef;
|
||||
}
|
||||
|
||||
public string Property(EdmProperty edmProperty)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
Accessibility.ForProperty(edmProperty),
|
||||
_typeMapper.GetTypeName(edmProperty.TypeUsage),
|
||||
_code.Escape(edmProperty),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
|
||||
}
|
||||
|
||||
public string NavigationProperty(NavigationProperty navProp)
|
||||
{
|
||||
var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
|
||||
navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
|
||||
_code.Escape(navProp),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(navProp)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(navProp)));
|
||||
}
|
||||
|
||||
public string AccessibilityAndVirtual(string accessibility)
|
||||
{
|
||||
return accessibility + (accessibility != "private" ? " virtual" : "");
|
||||
}
|
||||
|
||||
public string EntityClassOpening(EntityType entity)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1}partial class {2}{3}",
|
||||
Accessibility.ForType(entity),
|
||||
_code.SpaceAfter(_code.AbstractOption(entity)),
|
||||
_code.Escape(entity),
|
||||
_code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
|
||||
}
|
||||
|
||||
public string EnumOpening(SimpleType enumType)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} enum {1} : {2}",
|
||||
Accessibility.ForType(enumType),
|
||||
_code.Escape(enumType),
|
||||
_code.Escape(_typeMapper.UnderlyingClrType(enumType)));
|
||||
}
|
||||
|
||||
public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
|
||||
{
|
||||
var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
|
||||
{
|
||||
var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
|
||||
var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
|
||||
var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
|
||||
writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
|
||||
}
|
||||
}
|
||||
|
||||
public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} IQueryable<{1}> {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
_code.Escape(edmFunction),
|
||||
string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
|
||||
}
|
||||
|
||||
public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
edmFunction.NamespaceName,
|
||||
edmFunction.Name,
|
||||
string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
|
||||
_code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
|
||||
}
|
||||
|
||||
public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
|
||||
if (includeMergeOption)
|
||||
{
|
||||
paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
_code.Escape(edmFunction),
|
||||
paramList);
|
||||
}
|
||||
|
||||
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
|
||||
if (includeMergeOption)
|
||||
{
|
||||
callParams = ", mergeOption" + callParams;
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
|
||||
returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
edmFunction.Name,
|
||||
callParams);
|
||||
}
|
||||
|
||||
public string DbSet(EntitySet entitySet)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} virtual DbSet<{1}> {2} {{ get; set; }}",
|
||||
Accessibility.ForReadOnlyProperty(entitySet),
|
||||
_typeMapper.GetTypeName(entitySet.ElementType),
|
||||
_code.Escape(entitySet));
|
||||
}
|
||||
|
||||
public string DbSetInitializer(EntitySet entitySet)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} = Set<{1}>();",
|
||||
_code.Escape(entitySet),
|
||||
_typeMapper.GetTypeName(entitySet.ElementType));
|
||||
}
|
||||
|
||||
public string UsingDirectives(bool inHeader, bool includeCollections = true)
|
||||
{
|
||||
return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
|
||||
? string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}using System;{1}" +
|
||||
"{2}",
|
||||
inHeader ? Environment.NewLine : "",
|
||||
includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
|
||||
inHeader ? "" : Environment.NewLine)
|
||||
: "";
|
||||
}
|
||||
}
|
||||
|
||||
public class TypeMapper
|
||||
{
|
||||
private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
|
||||
|
||||
private readonly System.Collections.IList _errors;
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public static string FixNamespaces(string typeName)
|
||||
{
|
||||
return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
|
||||
}
|
||||
|
||||
public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
ArgumentNotNull(errors, "errors");
|
||||
|
||||
_code = code;
|
||||
_ef = ef;
|
||||
_errors = errors;
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, string modelNamespace)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
|
||||
{
|
||||
if (edmType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var collectionType = edmType as CollectionType;
|
||||
if (collectionType != null)
|
||||
{
|
||||
return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
|
||||
}
|
||||
|
||||
var typeName = _code.Escape(edmType.MetadataProperties
|
||||
.Where(p => p.Name == ExternalTypeNameAttributeName)
|
||||
.Select(p => (string)p.Value)
|
||||
.FirstOrDefault())
|
||||
?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
|
||||
_code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
|
||||
_code.Escape(edmType));
|
||||
|
||||
if (edmType is StructuralType)
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
if (edmType is SimpleType)
|
||||
{
|
||||
var clrType = UnderlyingClrType(edmType);
|
||||
if (!IsEnumType(edmType))
|
||||
{
|
||||
typeName = _code.Escape(clrType);
|
||||
}
|
||||
|
||||
typeName = FixNamespaces(typeName);
|
||||
|
||||
return clrType.IsValueType && isNullable == true ?
|
||||
String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
|
||||
typeName;
|
||||
}
|
||||
|
||||
throw new ArgumentException("edmType");
|
||||
}
|
||||
|
||||
public Type UnderlyingClrType(EdmType edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
var primitiveType = edmType as PrimitiveType;
|
||||
if (primitiveType != null)
|
||||
{
|
||||
return primitiveType.ClrEquivalentType;
|
||||
}
|
||||
|
||||
if (IsEnumType(edmType))
|
||||
{
|
||||
return GetEnumUnderlyingType(edmType).ClrEquivalentType;
|
||||
}
|
||||
|
||||
return typeof(object);
|
||||
}
|
||||
|
||||
public object GetEnumMemberValue(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var valueProperty = enumMember.GetType().GetProperty("Value");
|
||||
return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public string GetEnumMemberName(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var nameProperty = enumMember.GetType().GetProperty("Name");
|
||||
return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var membersProperty = enumType.GetType().GetProperty("Members");
|
||||
return membersProperty != null
|
||||
? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
|
||||
: Enumerable.Empty<MetadataItem>();
|
||||
}
|
||||
|
||||
public bool EnumIsFlags(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
|
||||
return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public bool IsEnumType(GlobalItem edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
return edmType.GetType().Name == "EnumType";
|
||||
}
|
||||
|
||||
public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public string CreateLiteral(object value)
|
||||
{
|
||||
if (value == null || value.GetType() != typeof(TimeSpan))
|
||||
{
|
||||
return _code.CreateLiteral(value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
|
||||
}
|
||||
|
||||
public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
|
||||
{
|
||||
ArgumentNotNull(types, "types");
|
||||
ArgumentNotNull(sourceFile, "sourceFile");
|
||||
|
||||
var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
if (types.Any(item => !hash.Add(item)))
|
||||
{
|
||||
_errors.Add(
|
||||
new CompilerError(sourceFile, -1, -1, "6023",
|
||||
String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return GetItemsToGenerate<SimpleType>(itemCollection)
|
||||
.Where(e => IsEnumType(e));
|
||||
}
|
||||
|
||||
public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
|
||||
{
|
||||
return itemCollection
|
||||
.OfType<T>()
|
||||
.Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
|
||||
.OrderBy(i => i.Name);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return itemCollection
|
||||
.Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
|
||||
.Select(g => GetGlobalItemName(g));
|
||||
}
|
||||
|
||||
public string GetGlobalItemName(GlobalItem item)
|
||||
{
|
||||
if (item is EdmType)
|
||||
{
|
||||
return ((EdmType)item).Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((EntityContainer)item).Name;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
|
||||
}
|
||||
|
||||
public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
|
||||
return returnParamsProperty == null
|
||||
? edmFunction.ReturnParameter
|
||||
: ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
|
||||
}
|
||||
|
||||
public bool IsComposable(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
|
||||
return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
|
||||
}
|
||||
|
||||
public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
|
||||
{
|
||||
return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
}
|
||||
|
||||
public TypeUsage GetReturnType(EdmFunction edmFunction)
|
||||
{
|
||||
var returnParam = GetReturnParameter(edmFunction);
|
||||
return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
|
||||
}
|
||||
|
||||
public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
|
||||
{
|
||||
var returnType = GetReturnType(edmFunction);
|
||||
return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ArgumentNotNull<T>(T arg, string name) where T : class
|
||||
{
|
||||
if (arg == null)
|
||||
{
|
||||
throw new ArgumentNullException(name);
|
||||
}
|
||||
}
|
||||
#>
|
||||
10
AUTS.Domain/Entities/InHaosEntity.Designer.cs
generated
Normal file
10
AUTS.Domain/Entities/InHaosEntity.Designer.cs
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
// 为模型“D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\AUTS-DATA(uts-data)\AUTS.Domain\Entities\InHaosEntity.edmx”启用了 T4 代码生成。
|
||||
// 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值
|
||||
// 更改为“旧的 ObjectContext”。当在设计器中打开该模型时,此属性会出现在
|
||||
// “属性”窗口中。
|
||||
|
||||
// 如果没有生成任何上下文和实体类,可能是因为您创建了空模型但是
|
||||
// 尚未选择要使用的实体框架版本。要为您的模型生成一个上下文类和实体
|
||||
// 类,请在设计器中打开该模型,右键单击设计器图面,然后
|
||||
// 选择“从数据库更新模型...”、“从模型生成数据库...”或“添加代码生成
|
||||
// 项...”。
|
||||
0
AUTS.Domain/Entities/InHaosEntity.cs
Normal file
0
AUTS.Domain/Entities/InHaosEntity.cs
Normal file
780
AUTS.Domain/Entities/InHaosEntity.edmx
Normal file
780
AUTS.Domain/Entities/InHaosEntity.edmx
Normal file
@@ -0,0 +1,780 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
|
||||
<!-- EF Runtime content -->
|
||||
<edmx:Runtime>
|
||||
<!-- SSDL content -->
|
||||
<edmx:StorageModels>
|
||||
<Schema Namespace="Uts_InHaosModel.Store" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.5" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
|
||||
<EntityType Name="TBL_Customer">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="CustomerAbbr" Type="varchar" MaxLength="64" Nullable="false" />
|
||||
<Property Name="CustomerName" Type="varchar" MaxLength="64" Nullable="false" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_FlowCtr">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="ProjectID" Type="int" />
|
||||
<Property Name="SUT_SN" Type="varchar" MaxLength="254" />
|
||||
<Property Name="ProcessRecord" Type="varchar" MaxLength="254" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_Log">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" Nullable="false" />
|
||||
<Property Name="UserID" Type="int" />
|
||||
<Property Name="DateTime" Type="datetime" Precision="0" />
|
||||
<Property Name="Operation" Type="varchar" MaxLength="254" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_OrderInternal">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="OrderID" Type="int" Nullable="false" />
|
||||
<Property Name="InternalNo" Type="varchar" MaxLength="64" Nullable="false" />
|
||||
<Property Name="CompanyID" Type="int" />
|
||||
<Property Name="ProductID" Type="int" />
|
||||
<Property Name="ProductTypeID" Type="int" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
<Property Name="ObjectiveYield" Type="int" Nullable="false" />
|
||||
<Property Name="ObjectiveYieldTotal" Type="int" Nullable="false" />
|
||||
<Property Name="OrderStatus" Type="int" />
|
||||
<Property Name="DeliveryTime" Type="datetime" Precision="0" />
|
||||
<Property Name="Station" Type="varchar" MaxLength="254" />
|
||||
<Property Name="BarCode" Type="varchar" MaxLength="254" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_Orders">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="CompanyID" Type="int" Nullable="false" />
|
||||
<Property Name="ProductID" Type="int" Nullable="false" />
|
||||
<Property Name="ProductTypeID" Type="int" Nullable="false" />
|
||||
<Property Name="OrderNo" Type="varchar" MaxLength="64" Nullable="false" />
|
||||
<Property Name="OrderCount" Type="int" Nullable="false" />
|
||||
<Property Name="DeliveryTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
<Property Name="CostPrice" Type="float" Nullable="false" />
|
||||
<Property Name="TransactPrice" Type="float" Nullable="false" />
|
||||
<Property Name="OrderStatus" Type="int" Nullable="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_ProductionLine">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="Name" Type="varchar" MaxLength="64" Nullable="false" />
|
||||
<Property Name="Description" Type="varchar" MaxLength="255" />
|
||||
<Property Name="Remark" Type="varchar" MaxLength="255" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_ProductionPlan">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="OrderID" Type="int" Nullable="false" />
|
||||
<Property Name="ProductionLineID" Type="int" Nullable="false" />
|
||||
<Property Name="OrderInternalID" Type="int" Nullable="false" />
|
||||
<Property Name="StationID" Type="int" Nullable="false" />
|
||||
<Property Name="ProductionTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
<Property Name="ActualOutput" Type="int" Nullable="false" />
|
||||
<Property Name="ObjectiveYield" Type="int" Nullable="false" />
|
||||
<Property Name="Remark" Type="varchar" MaxLength="255" />
|
||||
<Property Name="Sn_Start" Type="varchar" MaxLength="255" />
|
||||
<Property Name="Sn_End" Type="varchar" MaxLength="255" />
|
||||
<Property Name="ObjectiveYieldTotal" Type="int" Nullable="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_ProductTypes">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="ProductType" Type="varchar" MaxLength="255" Nullable="false" />
|
||||
<Property Name="Remark" Type="varchar" MaxLength="255" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_Project">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="ProductTypeID" Type="int" />
|
||||
<Property Name="ProjectName" Type="varchar" MaxLength="64" Nullable="false" />
|
||||
<Property Name="Description" Type="varchar" MaxLength="64" />
|
||||
<Property Name="UserID" Type="int" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" />
|
||||
<Property Name="Remark" Type="varchar" MaxLength="254" />
|
||||
<Property Name="PreviewImage" Type="blob" />
|
||||
<Property Name="Price" Type="float" />
|
||||
<Property Name="Currency" Type="varchar" MaxLength="10" />
|
||||
<Property Name="IsValid" Type="tinyint" />
|
||||
<Property Name="EolDate" Type="datetime" Precision="0" />
|
||||
<Property Name="ImageName" Type="varchar" MaxLength="255" />
|
||||
<Property Name="Type" Type="int" />
|
||||
<Property Name="SnType" Type="int" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_SnList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="OrderID" Type="int" />
|
||||
<Property Name="OrderInternalID" Type="int" />
|
||||
<Property Name="ProductID" Type="int" Nullable="false" />
|
||||
<Property Name="BarCode" Type="varchar" MaxLength="255" Nullable="false" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
<Property Name="UpdateTime" Type="datetime" Precision="0" />
|
||||
<Property Name="SnType" Type="int" />
|
||||
<Property Name="AssemblySn" Type="varchar" MaxLength="254" />
|
||||
<Property Name="AssemblyTime" Type="datetime" Precision="0" />
|
||||
<Property Name="S1" Type="datetime" Precision="0" />
|
||||
<Property Name="S2" Type="datetime" Precision="0" />
|
||||
<Property Name="S3" Type="datetime" Precision="0" />
|
||||
<Property Name="S4" Type="datetime" Precision="0" />
|
||||
<Property Name="S5" Type="datetime" Precision="0" />
|
||||
<Property Name="S6" Type="datetime" Precision="0" />
|
||||
<Property Name="S7" Type="datetime" Precision="0" />
|
||||
<Property Name="S8" Type="datetime" Precision="0" />
|
||||
<Property Name="S9" Type="datetime" Precision="0" />
|
||||
<Property Name="S10" Type="datetime" Precision="0" />
|
||||
<Property Name="S11" Type="datetime" Precision="0" />
|
||||
<Property Name="S12" Type="datetime" Precision="0" />
|
||||
<Property Name="Result1" Type="tinyint" />
|
||||
<Property Name="Result2" Type="tinyint" />
|
||||
<Property Name="Result3" Type="tinyint" />
|
||||
<Property Name="Result4" Type="tinyint" />
|
||||
<Property Name="Result5" Type="tinyint" />
|
||||
<Property Name="Result6" Type="tinyint" />
|
||||
<Property Name="Result7" Type="tinyint" />
|
||||
<Property Name="Result8" Type="tinyint" />
|
||||
<Property Name="Result9" Type="tinyint" />
|
||||
<Property Name="Result10" Type="tinyint" />
|
||||
<Property Name="Result11" Type="tinyint" />
|
||||
<Property Name="Result12" Type="tinyint" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_SnRules">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="OrderID" Type="int" Nullable="false" />
|
||||
<Property Name="OrderInternalID" Type="int" Nullable="false" />
|
||||
<Property Name="ProductID" Type="int" Nullable="false" />
|
||||
<Property Name="StationIDs" Type="varchar" MaxLength="255" Nullable="false" />
|
||||
<Property Name="Sn_Prefix" Type="varchar" MaxLength="255" />
|
||||
<Property Name="Sn_Start" Type="varchar" MaxLength="11" Nullable="false" />
|
||||
<Property Name="Sn_End" Type="varchar" MaxLength="11" Nullable="false" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_StationList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="ProjectID" Type="int" Nullable="false" />
|
||||
<Property Name="StationName" Type="varchar" MaxLength="255" Nullable="false" />
|
||||
<Property Name="StationType" Type="varchar" MaxLength="255" Nullable="false" />
|
||||
<Property Name="ArtworkOrder" Type="int" Nullable="false" />
|
||||
<Property Name="StationDesc" Type="varchar" MaxLength="255" />
|
||||
<Property Name="LastUpdateDate" Type="datetime" Precision="0" />
|
||||
<Property Name="LogTableName" Type="varchar" MaxLength="255" />
|
||||
<Property Name="BinPackage" Type="blob" />
|
||||
<Property Name="BinPackageMd5" Type="varchar" MaxLength="255" />
|
||||
<Property Name="PreviewImage" Type="blob" />
|
||||
<Property Name="Remark" Type="varchar" MaxLength="255" />
|
||||
<Property Name="PacketName" Type="varchar" MaxLength="255" />
|
||||
<Property Name="SnListOrder" Type="int" />
|
||||
<Property Name="IsValid" Type="tinyint" />
|
||||
<Property Name="SnType" Type="int" />
|
||||
<Property Name="EditPwd" Type="varchar" MaxLength="32" />
|
||||
<Property Name="ReleasePwd" Type="varchar" MaxLength="32" />
|
||||
<Property Name="PacketMd5" Type="varchar" MaxLength="32" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_SyncList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="CurrentDate" Type="datetime" Precision="0" />
|
||||
<Property Name="TableName" Type="varchar" MaxLength="254" Nullable="false" />
|
||||
<Property Name="RevisionID" Type="int" Nullable="false" />
|
||||
<Property Name="SyncType" Type="varchar" MaxLength="254" />
|
||||
</EntityType>
|
||||
|
||||
<!--<EntityType Name="TBL_SyncList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="CurrentDate" Type="datetime" Precision="0" />
|
||||
<Property Name="TableName" Type="varchar" MaxLength="254" Nullable="false" />
|
||||
<Property Name="RevisionID" Type="int" Nullable="false" />
|
||||
<Property Name="SyncType" Type="varchar" MaxLength="254" />
|
||||
</EntityType>-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<EntityType Name="TBL_RepairRequest">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
|
||||
<Property Name="UserID" Type="int" Nullable="false"/>
|
||||
<Property Name="RepairRequestNum" Type="varchar" MaxLength="254" Nullable="false" />
|
||||
<Property Name="ProductID" Type="int" Nullable="false" />
|
||||
<Property Name="Barcode" Type="varchar" MaxLength="254" Nullable="false" />
|
||||
<Property Name="ProductImage" Type="varchar" MaxLength="254" Nullable="true" />
|
||||
<Property Name="RejectSource" Type="varchar" MaxLength="254" Nullable="true" />
|
||||
<Property Name="RejectCode" Type="varchar" MaxLength="254" Nullable="true" />
|
||||
<Property Name="RejectDesc" Type="varchar" MaxLength="254" Nullable="true" />
|
||||
<Property Name="CreateTime" Type="datetime" Precision="0" Nullable="true"/>
|
||||
<Property Name="UpdateTime" Type="datetime" Precision="0" Nullable="true"/>
|
||||
<Property Name="RepairProgress" Type="varchar" MaxLength="64" Nullable="true" />
|
||||
<Property Name="RepairResult" Type="int" Nullable="true" />
|
||||
<Property Name="RepairLogID" Type="int" Nullable="true" />
|
||||
<Property Name="Repairier" Type="int" Nullable="true" />
|
||||
<Property Name="Remark" Type="varchar" MaxLength="254" Nullable="true" />
|
||||
<Property Name="ProductlMarking" Type="varchar" MaxLength="254" Nullable="true" />
|
||||
</EntityType>
|
||||
|
||||
|
||||
|
||||
<EntityContainer Name="Uts_InHaosModelStoreContainer">
|
||||
<EntitySet Name="TBL_Customer" EntityType="Self.TBL_Customer" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_FlowCtr" EntityType="Self.TBL_FlowCtr" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_Log" EntityType="Self.TBL_Log" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_OrderInternal" EntityType="Self.TBL_OrderInternal" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_Orders" EntityType="Self.TBL_Orders" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_ProductionLine" EntityType="Self.TBL_ProductionLine" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_ProductionPlan" EntityType="Self.TBL_ProductionPlan" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_ProductTypes" EntityType="Self.TBL_ProductTypes" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_Project" EntityType="Self.TBL_Project" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_SnList" EntityType="Self.TBL_SnList" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_SnRules" EntityType="Self.TBL_SnRules" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_StationList" EntityType="Self.TBL_StationList" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_SyncList" EntityType="Self.TBL_SyncList" Schema="uts_inhaos" store:Type="Tables" />
|
||||
<EntitySet Name="TBL_RepairRequest" EntityType="Self.TBL_RepairRequest" Schema="uts_inhaos" store:Type="Tables" />
|
||||
</EntityContainer>
|
||||
</Schema></edmx:StorageModels>
|
||||
<!-- CSDL content -->
|
||||
<edmx:ConceptualModels>
|
||||
<Schema Namespace="Uts_InHaosModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
|
||||
<EntityContainer Name="Uts_InHaosEntities" annotation:LazyLoadingEnabled="true">
|
||||
<EntitySet Name="TBL_FlowCtr" EntityType="Uts_InHaosModel.TBL_FlowCtr" />
|
||||
<EntitySet Name="TBL_Log" EntityType="Uts_InHaosModel.TBL_Log" />
|
||||
<EntitySet Name="TBL_ProductionLine" EntityType="Uts_InHaosModel.TBL_ProductionLine" />
|
||||
<EntitySet Name="TBL_SyncList" EntityType="Uts_InHaosModel.TBL_SyncList" />
|
||||
<EntitySet Name="TBL_ProductionPlan" EntityType="Uts_InHaosModel.TBL_ProductionPlan" />
|
||||
<EntitySet Name="TBL_SnRules" EntityType="Uts_InHaosModel.TBL_SnRules" />
|
||||
<EntitySet Name="TBL_SnList" EntityType="Uts_InHaosModel.TBL_SnList" />
|
||||
<EntitySet Name="TBL_ProductTypes" EntityType="Uts_InHaosModel.TBL_ProductTypes" />
|
||||
<EntitySet Name="TBL_Customer" EntityType="Uts_InHaosModel.TBL_Customer" />
|
||||
<EntitySet Name="TBL_Project" EntityType="Uts_InHaosModel.TBL_Project" />
|
||||
<EntitySet Name="TBL_StationList" EntityType="Uts_InHaosModel.TBL_StationList" />
|
||||
<EntitySet Name="TBL_OrderInternal" EntityType="Uts_InHaosModel.TBL_OrderInternal" />
|
||||
<EntitySet Name="TBL_Orders" EntityType="Uts_InHaosModel.TBL_Orders" />
|
||||
<EntitySet Name="TBL_RepairRequestSet" EntityType="Uts_InHaosModel.TBL_RepairRequest" />
|
||||
</EntityContainer>
|
||||
<EntityType Name="TBL_FlowCtr">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="ProjectID" Type="Int32" />
|
||||
<Property Name="SUT_SN" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
<Property Name="ProcessRecord" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_Log">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" />
|
||||
<Property Name="UserID" Type="Int32" />
|
||||
<Property Name="DateTime" Type="DateTime" />
|
||||
<Property Name="Operation" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_ProductionLine">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="Name" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Description" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_SyncList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="CurrentDate" Type="DateTime" />
|
||||
<Property Name="TableName" Type="String" Nullable="false" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
<Property Name="RevisionID" Type="Int32" Nullable="false" />
|
||||
<Property Name="SyncType" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_ProductionPlan">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="OrderID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ProductionLineID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ProductionTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="ActualOutput" Type="Int32" Nullable="false" />
|
||||
<Property Name="ObjectiveYield" Type="Int32" Nullable="false" />
|
||||
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Sn_Start" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Sn_End" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="OrderInternalID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ObjectiveYieldTotal" Type="Int32" Nullable="false" />
|
||||
<Property Name="StationID" Type="Int32" Nullable="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_SnRules">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="OrderID" Type="Int32" Nullable="false" />
|
||||
<Property Name="OrderInternalID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ProductID" Type="Int32" Nullable="false" />
|
||||
<Property Name="StationIDs" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Sn_Prefix" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Sn_Start" Type="String" Nullable="false" MaxLength="11" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Sn_End" Type="String" Nullable="false" MaxLength="11" FixedLength="false" Unicode="false" />
|
||||
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_SnList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="OrderID" Type="Int32" Nullable="false" />
|
||||
<Property Name="OrderInternalID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ProductID" Type="Int32" Nullable="false" />
|
||||
<Property Name="BarCode" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="S1" Type="DateTime" />
|
||||
<Property Name="S2" Type="DateTime" />
|
||||
<Property Name="S3" Type="DateTime" />
|
||||
<Property Name="S4" Type="DateTime" />
|
||||
<Property Name="S5" Type="DateTime" />
|
||||
<Property Name="S6" Type="DateTime" />
|
||||
<Property Name="S7" Type="DateTime" />
|
||||
<Property Name="S8" Type="DateTime" />
|
||||
<Property Name="S9" Type="DateTime" />
|
||||
<Property Name="S10" Type="DateTime" />
|
||||
<Property Name="S11" Type="DateTime" />
|
||||
<Property Name="S12" Type="DateTime" />
|
||||
<Property Name="UpdateTime" Type="DateTime" />
|
||||
<Property Name="Result1" Type="SByte" />
|
||||
<Property Name="Result2" Type="SByte" />
|
||||
<Property Name="Result3" Type="SByte" />
|
||||
<Property Name="Result4" Type="SByte" />
|
||||
<Property Name="Result5" Type="SByte" />
|
||||
<Property Name="Result6" Type="SByte" />
|
||||
<Property Name="Result7" Type="SByte" />
|
||||
<Property Name="Result8" Type="SByte" />
|
||||
<Property Name="Result9" Type="SByte" />
|
||||
<Property Name="Result10" Type="SByte" />
|
||||
<Property Name="Result11" Type="SByte" />
|
||||
<Property Name="Result12" Type="SByte" />
|
||||
<Property Name="SnType" Type="Int32" />
|
||||
<Property Name="AssemblySn" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
<Property Name="AssemblyTime" Type="DateTime" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_ProductTypes">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="ProductType" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_Customer">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="CustomerAbbr" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="CustomerName" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
|
||||
</EntityType>
|
||||
|
||||
<EntityType Name="TBL_Project">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="ProductTypeID" Type="Int32" />
|
||||
<Property Name="ProjectName" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Description" Type="String" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="UserID" Type="Int32" />
|
||||
<Property Name="CreateTime" Type="DateTime" />
|
||||
<Property Name="Remark" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
<Property Name="PreviewImage" Type="Binary" MaxLength="Max" FixedLength="false" />
|
||||
<Property Name="Price" Type="Single" />
|
||||
<Property Name="Currency" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
|
||||
<Property Name="IsValid" Type="SByte" />
|
||||
<Property Name="EolDate" Type="DateTime" />
|
||||
<Property Name="ImageName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="Type" Type="Int32" />
|
||||
<Property Name="SnType" Type="Int32" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_StationList">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="ProjectID" Type="Int32" Nullable="false" />
|
||||
<Property Name="StationName" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="StationType" Type="String" Nullable="false" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="ArtworkOrder" Type="Int32" Nullable="false" />
|
||||
<Property Name="StationDesc" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="LastUpdateDate" Type="DateTime" />
|
||||
<Property Name="LogTableName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="BinPackage" Type="Binary" MaxLength="Max" FixedLength="false" />
|
||||
<Property Name="BinPackageMd5" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="PreviewImage" Type="Binary" MaxLength="Max" FixedLength="false" />
|
||||
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="PacketName" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
|
||||
<Property Name="SnListOrder" Type="Int32" />
|
||||
<Property Name="IsValid" Type="SByte" />
|
||||
<Property Name="SnType" Type="Int32" />
|
||||
<Property Name="EditPwd" Type="String" MaxLength="32" FixedLength="false" Unicode="false" />
|
||||
<Property Name="ReleasePwd" Type="String" MaxLength="32" FixedLength="false" Unicode="false" />
|
||||
<Property Name="PacketMd5" Type="String" MaxLength="32" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_OrderInternal">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="OrderID" Type="Int32" Nullable="false" />
|
||||
<Property Name="InternalNo" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="CompanyID" Type="Int32" />
|
||||
<Property Name="ProductID" Type="Int32" />
|
||||
<Property Name="ProductTypeID" Type="Int32" />
|
||||
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="ObjectiveYield" Type="Int32" Nullable="false" />
|
||||
<Property Name="ObjectiveYieldTotal" Type="Int32" Nullable="false" />
|
||||
<Property Name="OrderStatus" Type="Int32" />
|
||||
<Property Name="DeliveryTime" Type="DateTime" />
|
||||
<Property Name="Station" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
<Property Name="BarCode" Type="String" MaxLength="254" FixedLength="false" Unicode="false" />
|
||||
</EntityType>
|
||||
<EntityType Name="TBL_Orders">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="CompanyID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ProductID" Type="Int32" Nullable="false" />
|
||||
<Property Name="ProductTypeID" Type="Int32" Nullable="false" />
|
||||
<Property Name="OrderNo" Type="String" Nullable="false" MaxLength="64" FixedLength="false" Unicode="false" />
|
||||
<Property Name="OrderCount" Type="Int32" Nullable="false" />
|
||||
<Property Name="DeliveryTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="CostPrice" Type="Single" Nullable="false" />
|
||||
<Property Name="TransactPrice" Type="Single" Nullable="false" />
|
||||
<Property Name="OrderStatus" Type="Int32" Nullable="false" />
|
||||
</EntityType>
|
||||
|
||||
<EntityType Name="TBL_RepairRequest">
|
||||
<Key>
|
||||
<PropertyRef Name="ID" />
|
||||
</Key>
|
||||
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
|
||||
<Property Name="UserID" Type="Int32" Nullable="false" />
|
||||
<Property Name="RepairRequestNum" Type="String" Nullable="false" />
|
||||
<Property Name="ProductID" Type="Int32" Nullable="false" />
|
||||
<Property Name="Barcode" Type="String" Nullable="false" />
|
||||
<Property Name="ProductImage" Type="String" Nullable="false" />
|
||||
<Property Name="RejectSource" Type="String" Nullable="false" />
|
||||
<Property Name="RejectCode" Type="String" Nullable="false" />
|
||||
<Property Name="RejectDesc" Type="String" Nullable="false" />
|
||||
<Property Name="CreateTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="UpdateTime" Type="DateTime" Nullable="false" />
|
||||
<Property Name="RepairProgress" Type="String" Nullable="false" />
|
||||
<Property Name="RepairResult" Type="Int32" Nullable="false" />
|
||||
<Property Name="RepairLogID" Type="Int32" Nullable="false" />
|
||||
<Property Name="Repairier" Type="Int32" Nullable="false" />
|
||||
<Property Name="Remark" Type="String" Nullable="false" />
|
||||
</EntityType>
|
||||
</Schema>
|
||||
</edmx:ConceptualModels>
|
||||
<!-- C-S mapping content -->
|
||||
<edmx:Mappings>
|
||||
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
|
||||
<EntityContainerMapping StorageEntityContainer="Uts_InHaosModelStoreContainer" CdmEntityContainer="Uts_InHaosEntities">
|
||||
<EntitySetMapping Name="TBL_FlowCtr">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_FlowCtr">
|
||||
<MappingFragment StoreEntitySet="TBL_FlowCtr">
|
||||
<ScalarProperty Name="ProcessRecord" ColumnName="ProcessRecord" />
|
||||
<ScalarProperty Name="SUT_SN" ColumnName="SUT_SN" />
|
||||
<ScalarProperty Name="ProjectID" ColumnName="ProjectID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_Log">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Log">
|
||||
<MappingFragment StoreEntitySet="TBL_Log">
|
||||
<ScalarProperty Name="Operation" ColumnName="Operation" />
|
||||
<ScalarProperty Name="DateTime" ColumnName="DateTime" />
|
||||
<ScalarProperty Name="UserID" ColumnName="UserID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_ProductionLine">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_ProductionLine">
|
||||
<MappingFragment StoreEntitySet="TBL_ProductionLine">
|
||||
<ScalarProperty Name="Remark" ColumnName="Remark" />
|
||||
<ScalarProperty Name="Description" ColumnName="Description" />
|
||||
<ScalarProperty Name="Name" ColumnName="Name" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_SyncList">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_SyncList">
|
||||
<MappingFragment StoreEntitySet="TBL_SyncList">
|
||||
<ScalarProperty Name="SyncType" ColumnName="SyncType" />
|
||||
<ScalarProperty Name="RevisionID" ColumnName="RevisionID" />
|
||||
<ScalarProperty Name="TableName" ColumnName="TableName" />
|
||||
<ScalarProperty Name="CurrentDate" ColumnName="CurrentDate" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_ProductionPlan">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_ProductionPlan">
|
||||
<MappingFragment StoreEntitySet="TBL_ProductionPlan">
|
||||
<ScalarProperty Name="StationID" ColumnName="StationID" />
|
||||
<ScalarProperty Name="ObjectiveYieldTotal" ColumnName="ObjectiveYieldTotal" />
|
||||
<ScalarProperty Name="OrderInternalID" ColumnName="OrderInternalID" />
|
||||
<ScalarProperty Name="Sn_End" ColumnName="Sn_End" />
|
||||
<ScalarProperty Name="Sn_Start" ColumnName="Sn_Start" />
|
||||
<ScalarProperty Name="Remark" ColumnName="Remark" />
|
||||
<ScalarProperty Name="ObjectiveYield" ColumnName="ObjectiveYield" />
|
||||
<ScalarProperty Name="ActualOutput" ColumnName="ActualOutput" />
|
||||
<ScalarProperty Name="ProductionTime" ColumnName="ProductionTime" />
|
||||
<ScalarProperty Name="ProductionLineID" ColumnName="ProductionLineID" />
|
||||
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_SnRules">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_SnRules">
|
||||
<MappingFragment StoreEntitySet="TBL_SnRules">
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="Sn_End" ColumnName="Sn_End" />
|
||||
<ScalarProperty Name="Sn_Start" ColumnName="Sn_Start" />
|
||||
<ScalarProperty Name="Sn_Prefix" ColumnName="Sn_Prefix" />
|
||||
<ScalarProperty Name="StationIDs" ColumnName="StationIDs" />
|
||||
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
|
||||
<ScalarProperty Name="OrderInternalID" ColumnName="OrderInternalID" />
|
||||
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_SnList">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_SnList">
|
||||
<MappingFragment StoreEntitySet="TBL_SnList">
|
||||
<ScalarProperty Name="AssemblyTime" ColumnName="AssemblyTime" />
|
||||
<ScalarProperty Name="AssemblySn" ColumnName="AssemblySn" />
|
||||
<ScalarProperty Name="SnType" ColumnName="SnType" />
|
||||
<ScalarProperty Name="Result12" ColumnName="Result12" />
|
||||
<ScalarProperty Name="Result11" ColumnName="Result11" />
|
||||
<ScalarProperty Name="Result10" ColumnName="Result10" />
|
||||
<ScalarProperty Name="Result9" ColumnName="Result9" />
|
||||
<ScalarProperty Name="Result8" ColumnName="Result8" />
|
||||
<ScalarProperty Name="Result7" ColumnName="Result7" />
|
||||
<ScalarProperty Name="Result6" ColumnName="Result6" />
|
||||
<ScalarProperty Name="Result5" ColumnName="Result5" />
|
||||
<ScalarProperty Name="Result4" ColumnName="Result4" />
|
||||
<ScalarProperty Name="Result3" ColumnName="Result3" />
|
||||
<ScalarProperty Name="Result2" ColumnName="Result2" />
|
||||
<ScalarProperty Name="Result1" ColumnName="Result1" />
|
||||
<ScalarProperty Name="UpdateTime" ColumnName="UpdateTime" />
|
||||
<ScalarProperty Name="S12" ColumnName="S12" />
|
||||
<ScalarProperty Name="S11" ColumnName="S11" />
|
||||
<ScalarProperty Name="S10" ColumnName="S10" />
|
||||
<ScalarProperty Name="S9" ColumnName="S9" />
|
||||
<ScalarProperty Name="S8" ColumnName="S8" />
|
||||
<ScalarProperty Name="S7" ColumnName="S7" />
|
||||
<ScalarProperty Name="S6" ColumnName="S6" />
|
||||
<ScalarProperty Name="S5" ColumnName="S5" />
|
||||
<ScalarProperty Name="S4" ColumnName="S4" />
|
||||
<ScalarProperty Name="S3" ColumnName="S3" />
|
||||
<ScalarProperty Name="S2" ColumnName="S2" />
|
||||
<ScalarProperty Name="S1" ColumnName="S1" />
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="BarCode" ColumnName="BarCode" />
|
||||
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
|
||||
<ScalarProperty Name="OrderInternalID" ColumnName="OrderInternalID" />
|
||||
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_ProductTypes">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_ProductTypes">
|
||||
<MappingFragment StoreEntitySet="TBL_ProductTypes">
|
||||
<ScalarProperty Name="Remark" ColumnName="Remark" />
|
||||
<ScalarProperty Name="ProductType" ColumnName="ProductType" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_Customer">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Customer">
|
||||
<MappingFragment StoreEntitySet="TBL_Customer">
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="CustomerName" ColumnName="CustomerName" />
|
||||
<ScalarProperty Name="CustomerAbbr" ColumnName="CustomerAbbr" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_Project">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Project">
|
||||
<MappingFragment StoreEntitySet="TBL_Project">
|
||||
<ScalarProperty Name="SnType" ColumnName="SnType" />
|
||||
<ScalarProperty Name="Type" ColumnName="Type" />
|
||||
<ScalarProperty Name="ImageName" ColumnName="ImageName" />
|
||||
<ScalarProperty Name="EolDate" ColumnName="EolDate" />
|
||||
<ScalarProperty Name="IsValid" ColumnName="IsValid" />
|
||||
<ScalarProperty Name="Currency" ColumnName="Currency" />
|
||||
<ScalarProperty Name="Price" ColumnName="Price" />
|
||||
<ScalarProperty Name="PreviewImage" ColumnName="PreviewImage" />
|
||||
<ScalarProperty Name="Remark" ColumnName="Remark" />
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="UserID" ColumnName="UserID" />
|
||||
<ScalarProperty Name="Description" ColumnName="Description" />
|
||||
<ScalarProperty Name="ProjectName" ColumnName="ProjectName" />
|
||||
<ScalarProperty Name="ProductTypeID" ColumnName="ProductTypeID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_StationList">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_StationList">
|
||||
<MappingFragment StoreEntitySet="TBL_StationList">
|
||||
<ScalarProperty Name="PacketMd5" ColumnName="PacketMd5" />
|
||||
<ScalarProperty Name="ReleasePwd" ColumnName="ReleasePwd" />
|
||||
<ScalarProperty Name="EditPwd" ColumnName="EditPwd" />
|
||||
<ScalarProperty Name="SnType" ColumnName="SnType" />
|
||||
<ScalarProperty Name="IsValid" ColumnName="IsValid" />
|
||||
<ScalarProperty Name="SnListOrder" ColumnName="SnListOrder" />
|
||||
<ScalarProperty Name="PacketName" ColumnName="PacketName" />
|
||||
<ScalarProperty Name="Remark" ColumnName="Remark" />
|
||||
<ScalarProperty Name="PreviewImage" ColumnName="PreviewImage" />
|
||||
<ScalarProperty Name="BinPackageMd5" ColumnName="BinPackageMd5" />
|
||||
<ScalarProperty Name="BinPackage" ColumnName="BinPackage" />
|
||||
<ScalarProperty Name="LogTableName" ColumnName="LogTableName" />
|
||||
<ScalarProperty Name="LastUpdateDate" ColumnName="LastUpdateDate" />
|
||||
<ScalarProperty Name="StationDesc" ColumnName="StationDesc" />
|
||||
<ScalarProperty Name="ArtworkOrder" ColumnName="ArtworkOrder" />
|
||||
<ScalarProperty Name="StationType" ColumnName="StationType" />
|
||||
<ScalarProperty Name="StationName" ColumnName="StationName" />
|
||||
<ScalarProperty Name="ProjectID" ColumnName="ProjectID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_OrderInternal">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_OrderInternal">
|
||||
<MappingFragment StoreEntitySet="TBL_OrderInternal">
|
||||
<ScalarProperty Name="BarCode" ColumnName="BarCode" />
|
||||
<ScalarProperty Name="Station" ColumnName="Station" />
|
||||
<ScalarProperty Name="DeliveryTime" ColumnName="DeliveryTime" />
|
||||
<ScalarProperty Name="OrderStatus" ColumnName="OrderStatus" />
|
||||
<ScalarProperty Name="ObjectiveYieldTotal" ColumnName="ObjectiveYieldTotal" />
|
||||
<ScalarProperty Name="ObjectiveYield" ColumnName="ObjectiveYield" />
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="ProductTypeID" ColumnName="ProductTypeID" />
|
||||
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
|
||||
<ScalarProperty Name="CompanyID" ColumnName="CompanyID" />
|
||||
<ScalarProperty Name="InternalNo" ColumnName="InternalNo" />
|
||||
<ScalarProperty Name="OrderID" ColumnName="OrderID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_Orders">
|
||||
<EntityTypeMapping TypeName="Uts_InHaosModel.TBL_Orders">
|
||||
<MappingFragment StoreEntitySet="TBL_Orders">
|
||||
<ScalarProperty Name="OrderStatus" ColumnName="OrderStatus" />
|
||||
<ScalarProperty Name="TransactPrice" ColumnName="TransactPrice" />
|
||||
<ScalarProperty Name="CostPrice" ColumnName="CostPrice" />
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="DeliveryTime" ColumnName="DeliveryTime" />
|
||||
<ScalarProperty Name="OrderCount" ColumnName="OrderCount" />
|
||||
<ScalarProperty Name="OrderNo" ColumnName="OrderNo" />
|
||||
<ScalarProperty Name="ProductTypeID" ColumnName="ProductTypeID" />
|
||||
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
|
||||
<ScalarProperty Name="CompanyID" ColumnName="CompanyID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
<EntitySetMapping Name="TBL_RepairRequestSet">
|
||||
<EntityTypeMapping TypeName="IsTypeOf(Uts_InHaosModel.TBL_RepairRequest)">
|
||||
<MappingFragment StoreEntitySet="TBL_RepairRequest">
|
||||
<!--<ScalarProperty Name="ProductlMarking" ColumnName="ProductlMarking" />-->
|
||||
<ScalarProperty Name="Remark" ColumnName="Remark" />
|
||||
<ScalarProperty Name="Repairier" ColumnName="Repairier" />
|
||||
<ScalarProperty Name="RepairLogID" ColumnName="RepairLogID" />
|
||||
<ScalarProperty Name="RepairResult" ColumnName="RepairResult" />
|
||||
<ScalarProperty Name="RepairProgress" ColumnName="RepairProgress" />
|
||||
<ScalarProperty Name="UpdateTime" ColumnName="UpdateTime" />
|
||||
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
|
||||
<ScalarProperty Name="RejectDesc" ColumnName="RejectDesc" />
|
||||
<ScalarProperty Name="RejectCode" ColumnName="RejectCode" />
|
||||
<ScalarProperty Name="RejectSource" ColumnName="RejectSource" />
|
||||
<ScalarProperty Name="ProductImage" ColumnName="ProductImage" />
|
||||
<ScalarProperty Name="Barcode" ColumnName="Barcode" />
|
||||
<ScalarProperty Name="ProductID" ColumnName="ProductID" />
|
||||
<ScalarProperty Name="RepairRequestNum" ColumnName="RepairRequestNum" />
|
||||
<ScalarProperty Name="UserID" ColumnName="UserID" />
|
||||
<ScalarProperty Name="ID" ColumnName="ID" />
|
||||
</MappingFragment>
|
||||
</EntityTypeMapping>
|
||||
</EntitySetMapping>
|
||||
</EntityContainerMapping>
|
||||
</Mapping>
|
||||
</edmx:Mappings>
|
||||
</edmx:Runtime>
|
||||
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
|
||||
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
|
||||
<Connection>
|
||||
<DesignerInfoPropertySet>
|
||||
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
|
||||
</DesignerInfoPropertySet>
|
||||
</Connection>
|
||||
<Options>
|
||||
<DesignerInfoPropertySet>
|
||||
<DesignerProperty Name="ValidateOnBuild" Value="true" />
|
||||
<DesignerProperty Name="EnablePluralization" Value="false" />
|
||||
<DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
|
||||
<DesignerProperty Name="UseLegacyProvider" Value="false" />
|
||||
<DesignerProperty Name="CodeGenerationStrategy" Value="无" />
|
||||
</DesignerInfoPropertySet>
|
||||
</Options>
|
||||
<!-- Diagram content (shape and connector positions) -->
|
||||
<Diagrams></Diagrams>
|
||||
</Designer>
|
||||
</edmx:Edmx>
|
||||
25
AUTS.Domain/Entities/InHaosEntity.edmx.diagram
Normal file
25
AUTS.Domain/Entities/InHaosEntity.edmx.diagram
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
|
||||
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
|
||||
<edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
|
||||
<!-- Diagram content (shape and connector positions) -->
|
||||
<edmx:Diagrams>
|
||||
<Diagram DiagramId="151a8c58f52a4202a3c014c3e9d5354a" Name="Diagram1">
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_FlowCtr" Width="1.5" PointX="2.75" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Log" Width="1.5" PointX="0.75" PointY="3.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_ProductionLine" Width="1.5" PointX="4.75" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_SyncList" Width="1.5" PointX="0.875" PointY="6.25" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_ProductionPlan" Width="1.5" PointX="9.375" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_SnRules" Width="1.5" PointX="11" PointY="5.25" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_SnList" PointX="13" PointY="0.5" Width="1.5" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_ProductTypes" Width="1.5" PointX="9.375" PointY="4.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Customer" Width="1.5" PointX="7.75" PointY="7.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Project" Width="1.5" PointX="2.75" PointY="9.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_StationList" Width="1.5" PointX="4.75" PointY="9.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_OrderInternal" Width="1.5" PointX="3.375" PointY="3.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_Orders" Width="1.5" PointX="5.375" PointY="3.75" />
|
||||
<EntityTypeShape EntityType="Uts_InHaosModel.TBL_RepairRequest" Width="1.5" PointX="7.25" PointY="2.625" />
|
||||
</Diagram>
|
||||
</edmx:Diagrams>
|
||||
</edmx:Designer>
|
||||
</edmx:Edmx>
|
||||
733
AUTS.Domain/Entities/InHaosEntity.tt
Normal file
733
AUTS.Domain/Entities/InHaosEntity.tt
Normal file
@@ -0,0 +1,733 @@
|
||||
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||
output extension=".cs"#><#
|
||||
|
||||
const string inputFile = @"InHaosEntity.edmx";
|
||||
var textTransform = DynamicTextTransformation.Create(this);
|
||||
var code = new CodeGenerationTools(this);
|
||||
var ef = new MetadataTools(this);
|
||||
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
|
||||
var fileManager = EntityFrameworkTemplateFileManager.Create(this);
|
||||
var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile);
|
||||
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
|
||||
|
||||
if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
WriteHeader(codeStringGenerator, fileManager);
|
||||
|
||||
foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection))
|
||||
{
|
||||
fileManager.StartNewFile(entity.Name + ".cs");
|
||||
BeginNamespace(code);
|
||||
#>
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: false)#>
|
||||
<#=codeStringGenerator.EntityClassOpening(entity)#>
|
||||
{
|
||||
<#
|
||||
var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity);
|
||||
var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity);
|
||||
var complexProperties = typeMapper.GetComplexProperties(entity);
|
||||
|
||||
if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
||||
public <#=code.Escape(entity)#>()
|
||||
{
|
||||
<#
|
||||
foreach (var edmProperty in propertiesWithDefaultValues)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var navigationProperty in collectionNavigationProperties)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>();
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var complexProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
|
||||
<#
|
||||
}
|
||||
#>
|
||||
}
|
||||
|
||||
<#
|
||||
}
|
||||
|
||||
var simpleProperties = typeMapper.GetSimpleProperties(entity);
|
||||
if (simpleProperties.Any())
|
||||
{
|
||||
foreach (var edmProperty in simpleProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(edmProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
|
||||
if (complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
|
||||
<#
|
||||
foreach(var complexProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(complexProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
|
||||
var navigationProperties = typeMapper.GetNavigationProperties(entity);
|
||||
if (navigationProperties.Any())
|
||||
{
|
||||
#>
|
||||
|
||||
<#
|
||||
foreach (var navigationProperty in navigationProperties)
|
||||
{
|
||||
if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many)
|
||||
{
|
||||
#>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#=codeStringGenerator.NavigationProperty(navigationProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
EndNamespace(code);
|
||||
}
|
||||
|
||||
foreach (var complex in typeMapper.GetItemsToGenerate<ComplexType>(itemCollection))
|
||||
{
|
||||
fileManager.StartNewFile(complex.Name + ".cs");
|
||||
BeginNamespace(code);
|
||||
#>
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
|
||||
<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#>
|
||||
{
|
||||
<#
|
||||
var complexProperties = typeMapper.GetComplexProperties(complex);
|
||||
var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex);
|
||||
|
||||
if (propertiesWithDefaultValues.Any() || complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
public <#=code.Escape(complex)#>()
|
||||
{
|
||||
<#
|
||||
foreach (var edmProperty in propertiesWithDefaultValues)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var complexProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
|
||||
<#
|
||||
}
|
||||
#>
|
||||
}
|
||||
|
||||
<#
|
||||
}
|
||||
|
||||
var simpleProperties = typeMapper.GetSimpleProperties(complex);
|
||||
if (simpleProperties.Any())
|
||||
{
|
||||
foreach(var edmProperty in simpleProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(edmProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
|
||||
if (complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
|
||||
<#
|
||||
foreach(var edmProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(edmProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
EndNamespace(code);
|
||||
}
|
||||
|
||||
foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection))
|
||||
{
|
||||
fileManager.StartNewFile(enumType.Name + ".cs");
|
||||
BeginNamespace(code);
|
||||
#>
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
|
||||
<#
|
||||
if (typeMapper.EnumIsFlags(enumType))
|
||||
{
|
||||
#>
|
||||
[Flags]
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#=codeStringGenerator.EnumOpening(enumType)#>
|
||||
{
|
||||
<#
|
||||
var foundOne = false;
|
||||
|
||||
foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType))
|
||||
{
|
||||
foundOne = true;
|
||||
#>
|
||||
<#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>,
|
||||
<#
|
||||
}
|
||||
|
||||
if (foundOne)
|
||||
{
|
||||
this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1);
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
EndNamespace(code);
|
||||
}
|
||||
|
||||
fileManager.Process();
|
||||
|
||||
#>
|
||||
<#+
|
||||
|
||||
public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager)
|
||||
{
|
||||
fileManager.StartHeader();
|
||||
#>
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
|
||||
//
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: true)#>
|
||||
<#+
|
||||
fileManager.EndBlock();
|
||||
}
|
||||
|
||||
public void BeginNamespace(CodeGenerationTools code)
|
||||
{
|
||||
var codeNamespace = code.VsNamespaceSuggestion();
|
||||
if (!String.IsNullOrEmpty(codeNamespace))
|
||||
{
|
||||
#>
|
||||
namespace <#=code.EscapeNamespace(codeNamespace)#>
|
||||
{
|
||||
<#+
|
||||
PushIndent(" ");
|
||||
}
|
||||
}
|
||||
|
||||
public void EndNamespace(CodeGenerationTools code)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion()))
|
||||
{
|
||||
PopIndent();
|
||||
#>
|
||||
}
|
||||
<#+
|
||||
}
|
||||
}
|
||||
|
||||
public const string TemplateId = "CSharp_DbContext_Types_EF6";
|
||||
|
||||
public class CodeStringGenerator
|
||||
{
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly TypeMapper _typeMapper;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(typeMapper, "typeMapper");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
|
||||
_code = code;
|
||||
_typeMapper = typeMapper;
|
||||
_ef = ef;
|
||||
}
|
||||
|
||||
public string Property(EdmProperty edmProperty)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
Accessibility.ForProperty(edmProperty),
|
||||
_typeMapper.GetTypeName(edmProperty.TypeUsage),
|
||||
_code.Escape(edmProperty),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
|
||||
}
|
||||
|
||||
public string NavigationProperty(NavigationProperty navProp)
|
||||
{
|
||||
var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
|
||||
navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
|
||||
_code.Escape(navProp),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(navProp)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(navProp)));
|
||||
}
|
||||
|
||||
public string AccessibilityAndVirtual(string accessibility)
|
||||
{
|
||||
return accessibility + (accessibility != "private" ? " virtual" : "");
|
||||
}
|
||||
|
||||
public string EntityClassOpening(EntityType entity)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1}partial class {2}{3}",
|
||||
Accessibility.ForType(entity),
|
||||
_code.SpaceAfter(_code.AbstractOption(entity)),
|
||||
_code.Escape(entity),
|
||||
_code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
|
||||
}
|
||||
|
||||
public string EnumOpening(SimpleType enumType)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} enum {1} : {2}",
|
||||
Accessibility.ForType(enumType),
|
||||
_code.Escape(enumType),
|
||||
_code.Escape(_typeMapper.UnderlyingClrType(enumType)));
|
||||
}
|
||||
|
||||
public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
|
||||
{
|
||||
var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
|
||||
{
|
||||
var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
|
||||
var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
|
||||
var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
|
||||
writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
|
||||
}
|
||||
}
|
||||
|
||||
public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} IQueryable<{1}> {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
_code.Escape(edmFunction),
|
||||
string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
|
||||
}
|
||||
|
||||
public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
edmFunction.NamespaceName,
|
||||
edmFunction.Name,
|
||||
string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
|
||||
_code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
|
||||
}
|
||||
|
||||
public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
|
||||
if (includeMergeOption)
|
||||
{
|
||||
paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
_code.Escape(edmFunction),
|
||||
paramList);
|
||||
}
|
||||
|
||||
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
|
||||
if (includeMergeOption)
|
||||
{
|
||||
callParams = ", mergeOption" + callParams;
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
|
||||
returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
edmFunction.Name,
|
||||
callParams);
|
||||
}
|
||||
|
||||
public string DbSet(EntitySet entitySet)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} virtual DbSet<{1}> {2} {{ get; set; }}",
|
||||
Accessibility.ForReadOnlyProperty(entitySet),
|
||||
_typeMapper.GetTypeName(entitySet.ElementType),
|
||||
_code.Escape(entitySet));
|
||||
}
|
||||
|
||||
public string UsingDirectives(bool inHeader, bool includeCollections = true)
|
||||
{
|
||||
return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
|
||||
? string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}using System;{1}" +
|
||||
"{2}",
|
||||
inHeader ? Environment.NewLine : "",
|
||||
includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
|
||||
inHeader ? "" : Environment.NewLine)
|
||||
: "";
|
||||
}
|
||||
}
|
||||
|
||||
public class TypeMapper
|
||||
{
|
||||
private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
|
||||
|
||||
private readonly System.Collections.IList _errors;
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
ArgumentNotNull(errors, "errors");
|
||||
|
||||
_code = code;
|
||||
_ef = ef;
|
||||
_errors = errors;
|
||||
}
|
||||
|
||||
public static string FixNamespaces(string typeName)
|
||||
{
|
||||
return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, string modelNamespace)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
|
||||
{
|
||||
if (edmType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var collectionType = edmType as CollectionType;
|
||||
if (collectionType != null)
|
||||
{
|
||||
return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
|
||||
}
|
||||
|
||||
var typeName = _code.Escape(edmType.MetadataProperties
|
||||
.Where(p => p.Name == ExternalTypeNameAttributeName)
|
||||
.Select(p => (string)p.Value)
|
||||
.FirstOrDefault())
|
||||
?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
|
||||
_code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
|
||||
_code.Escape(edmType));
|
||||
|
||||
if (edmType is StructuralType)
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
if (edmType is SimpleType)
|
||||
{
|
||||
var clrType = UnderlyingClrType(edmType);
|
||||
if (!IsEnumType(edmType))
|
||||
{
|
||||
typeName = _code.Escape(clrType);
|
||||
}
|
||||
|
||||
typeName = FixNamespaces(typeName);
|
||||
|
||||
return clrType.IsValueType && isNullable == true ?
|
||||
String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
|
||||
typeName;
|
||||
}
|
||||
|
||||
throw new ArgumentException("edmType");
|
||||
}
|
||||
|
||||
public Type UnderlyingClrType(EdmType edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
var primitiveType = edmType as PrimitiveType;
|
||||
if (primitiveType != null)
|
||||
{
|
||||
return primitiveType.ClrEquivalentType;
|
||||
}
|
||||
|
||||
if (IsEnumType(edmType))
|
||||
{
|
||||
return GetEnumUnderlyingType(edmType).ClrEquivalentType;
|
||||
}
|
||||
|
||||
return typeof(object);
|
||||
}
|
||||
|
||||
public object GetEnumMemberValue(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var valueProperty = enumMember.GetType().GetProperty("Value");
|
||||
return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public string GetEnumMemberName(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var nameProperty = enumMember.GetType().GetProperty("Name");
|
||||
return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var membersProperty = enumType.GetType().GetProperty("Members");
|
||||
return membersProperty != null
|
||||
? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
|
||||
: Enumerable.Empty<MetadataItem>();
|
||||
}
|
||||
|
||||
public bool EnumIsFlags(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
|
||||
return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public bool IsEnumType(GlobalItem edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
return edmType.GetType().Name == "EnumType";
|
||||
}
|
||||
|
||||
public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public string CreateLiteral(object value)
|
||||
{
|
||||
if (value == null || value.GetType() != typeof(TimeSpan))
|
||||
{
|
||||
return _code.CreateLiteral(value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
|
||||
}
|
||||
|
||||
public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
|
||||
{
|
||||
ArgumentNotNull(types, "types");
|
||||
ArgumentNotNull(sourceFile, "sourceFile");
|
||||
|
||||
var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
if (types.Any(item => !hash.Add(item)))
|
||||
{
|
||||
_errors.Add(
|
||||
new CompilerError(sourceFile, -1, -1, "6023",
|
||||
String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return GetItemsToGenerate<SimpleType>(itemCollection)
|
||||
.Where(e => IsEnumType(e));
|
||||
}
|
||||
|
||||
public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
|
||||
{
|
||||
return itemCollection
|
||||
.OfType<T>()
|
||||
.Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
|
||||
.OrderBy(i => i.Name);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return itemCollection
|
||||
.Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
|
||||
.Select(g => GetGlobalItemName(g));
|
||||
}
|
||||
|
||||
public string GetGlobalItemName(GlobalItem item)
|
||||
{
|
||||
if (item is EdmType)
|
||||
{
|
||||
return ((EdmType)item).Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((EntityContainer)item).Name;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
|
||||
}
|
||||
|
||||
public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
|
||||
return returnParamsProperty == null
|
||||
? edmFunction.ReturnParameter
|
||||
: ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
|
||||
}
|
||||
|
||||
public bool IsComposable(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
|
||||
return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
|
||||
}
|
||||
|
||||
public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
|
||||
{
|
||||
return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
}
|
||||
|
||||
public TypeUsage GetReturnType(EdmFunction edmFunction)
|
||||
{
|
||||
var returnParam = GetReturnParameter(edmFunction);
|
||||
return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
|
||||
}
|
||||
|
||||
public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
|
||||
{
|
||||
var returnType = GetReturnType(edmFunction);
|
||||
return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ArgumentNotNull<T>(T arg, string name) where T : class
|
||||
{
|
||||
if (arg == null)
|
||||
{
|
||||
throw new ArgumentNullException(name);
|
||||
}
|
||||
}
|
||||
#>
|
||||
52
AUTS.Domain/Entities/ManageEntity.Context.cs
Normal file
52
AUTS.Domain/Entities/ManageEntity.Context.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
|
||||
public partial class Uts_ManageEntities : DbContext
|
||||
{
|
||||
public Uts_ManageEntities()
|
||||
: base("name=Uts_ManageEntities")
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
throw new UnintentionalCodeFirstException();
|
||||
}
|
||||
|
||||
public virtual DbSet<TBL_UTS_Manage_TestPlanTips> TBL_UTS_Manage_TestPlanTips { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_ServiceLog> TBL_UTS_Manage_ServiceLog { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_ErrCode> TBL_UTS_Manage_ErrCode { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_AuthManage> TBL_UTS_Manage_AuthManage { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_Module> TBL_UTS_Manage_Module { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_AppList> TBL_UTS_Manage_AppList { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_AppLog> TBL_UTS_Manage_AppLog { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_DataServiceList> TBL_UTS_Manage_DataServiceList { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_DataServiceLog> TBL_UTS_Manage_DataServiceLog { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_DevLog> TBL_UTS_Manage_DevLog { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_LicenseList> TBL_UTS_Manage_LicenseList { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_Log> TBL_UTS_Manage_Log { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_SearchKey> TBL_UTS_Manage_SearchKey { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_SwReleaseLog> TBL_UTS_Manage_SwReleaseLog { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_SwUpdate> TBL_UTS_Manage_SwUpdate { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_SyncList> TBL_UTS_Manage_SyncList { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_User> TBL_UTS_Manage_User { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_UserAuth_Operation> TBL_UTS_Manage_UserAuth_Operation { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_UtsCmdList> TBL_UTS_Manage_UtsCmdList { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_AuthLog> TBL_UTS_Manage_AuthLog { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_OrderStatus> TBL_UTS_Manage_OrderStatus { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_DBList> TBL_UTS_Manage_DBList { get; set; }
|
||||
public virtual DbSet<TBL_UTS_Manage_Company> TBL_UTS_Manage_Company { get; set; }
|
||||
}
|
||||
}
|
||||
636
AUTS.Domain/Entities/ManageEntity.Context.tt
Normal file
636
AUTS.Domain/Entities/ManageEntity.Context.tt
Normal file
@@ -0,0 +1,636 @@
|
||||
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||
output extension=".cs"#><#
|
||||
|
||||
const string inputFile = @"ManageEntity.edmx";
|
||||
var textTransform = DynamicTextTransformation.Create(this);
|
||||
var code = new CodeGenerationTools(this);
|
||||
var ef = new MetadataTools(this);
|
||||
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
|
||||
var loader = new EdmMetadataLoader(textTransform.Host, textTransform.Errors);
|
||||
var itemCollection = loader.CreateEdmItemCollection(inputFile);
|
||||
var modelNamespace = loader.GetModelNamespace(inputFile);
|
||||
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
|
||||
|
||||
var container = itemCollection.OfType<EntityContainer>().FirstOrDefault();
|
||||
if (container == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
#>
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
|
||||
//
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
<#
|
||||
|
||||
var codeNamespace = code.VsNamespaceSuggestion();
|
||||
if (!String.IsNullOrEmpty(codeNamespace))
|
||||
{
|
||||
#>
|
||||
namespace <#=code.EscapeNamespace(codeNamespace)#>
|
||||
{
|
||||
<#
|
||||
PushIndent(" ");
|
||||
}
|
||||
|
||||
#>
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
<#
|
||||
if (container.FunctionImports.Any())
|
||||
{
|
||||
#>
|
||||
using System.Data.Entity.Core.Objects;
|
||||
using System.Linq;
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : DbContext
|
||||
{
|
||||
public <#=code.Escape(container)#>()
|
||||
: base("name=<#=container.Name#>")
|
||||
{
|
||||
<#
|
||||
if (!loader.IsLazyLoadingEnabled(container))
|
||||
{
|
||||
#>
|
||||
this.Configuration.LazyLoadingEnabled = false;
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
|
||||
{
|
||||
// Note: the DbSet members are defined below such that the getter and
|
||||
// setter always have the same accessibility as the DbSet definition
|
||||
if (Accessibility.ForReadOnlyProperty(entitySet) != "public")
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.DbSetInitializer(entitySet)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
throw new UnintentionalCodeFirstException();
|
||||
}
|
||||
|
||||
<#
|
||||
foreach (var entitySet in container.BaseEntitySets.OfType<EntitySet>())
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.DbSet(entitySet)#>
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var edmFunction in container.FunctionImports)
|
||||
{
|
||||
WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: false);
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
|
||||
if (!String.IsNullOrEmpty(codeNamespace))
|
||||
{
|
||||
PopIndent();
|
||||
#>
|
||||
}
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#+
|
||||
|
||||
private void WriteFunctionImport(TypeMapper typeMapper, CodeStringGenerator codeStringGenerator, EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
if (typeMapper.IsComposable(edmFunction))
|
||||
{
|
||||
#>
|
||||
|
||||
[DbFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")]
|
||||
<#=codeStringGenerator.ComposableFunctionMethod(edmFunction, modelNamespace)#>
|
||||
{
|
||||
<#+
|
||||
codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
|
||||
#>
|
||||
<#=codeStringGenerator.ComposableCreateQuery(edmFunction, modelNamespace)#>
|
||||
}
|
||||
<#+
|
||||
}
|
||||
else
|
||||
{
|
||||
#>
|
||||
|
||||
<#=codeStringGenerator.FunctionMethod(edmFunction, modelNamespace, includeMergeOption)#>
|
||||
{
|
||||
<#+
|
||||
codeStringGenerator.WriteFunctionParameters(edmFunction, WriteFunctionParameter);
|
||||
#>
|
||||
<#=codeStringGenerator.ExecuteFunction(edmFunction, modelNamespace, includeMergeOption)#>
|
||||
}
|
||||
<#+
|
||||
if (typeMapper.GenerateMergeOptionFunction(edmFunction, includeMergeOption))
|
||||
{
|
||||
WriteFunctionImport(typeMapper, codeStringGenerator, edmFunction, modelNamespace, includeMergeOption: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteFunctionParameter(string name, string isNotNull, string notNullInit, string nullInit)
|
||||
{
|
||||
#>
|
||||
var <#=name#> = <#=isNotNull#> ?
|
||||
<#=notNullInit#> :
|
||||
<#=nullInit#>;
|
||||
|
||||
<#+
|
||||
}
|
||||
|
||||
public const string TemplateId = "CSharp_DbContext_Context_EF6";
|
||||
|
||||
public class CodeStringGenerator
|
||||
{
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly TypeMapper _typeMapper;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(typeMapper, "typeMapper");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
|
||||
_code = code;
|
||||
_typeMapper = typeMapper;
|
||||
_ef = ef;
|
||||
}
|
||||
|
||||
public string Property(EdmProperty edmProperty)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
Accessibility.ForProperty(edmProperty),
|
||||
_typeMapper.GetTypeName(edmProperty.TypeUsage),
|
||||
_code.Escape(edmProperty),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
|
||||
}
|
||||
|
||||
public string NavigationProperty(NavigationProperty navProp)
|
||||
{
|
||||
var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
|
||||
navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
|
||||
_code.Escape(navProp),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(navProp)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(navProp)));
|
||||
}
|
||||
|
||||
public string AccessibilityAndVirtual(string accessibility)
|
||||
{
|
||||
return accessibility + (accessibility != "private" ? " virtual" : "");
|
||||
}
|
||||
|
||||
public string EntityClassOpening(EntityType entity)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1}partial class {2}{3}",
|
||||
Accessibility.ForType(entity),
|
||||
_code.SpaceAfter(_code.AbstractOption(entity)),
|
||||
_code.Escape(entity),
|
||||
_code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
|
||||
}
|
||||
|
||||
public string EnumOpening(SimpleType enumType)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} enum {1} : {2}",
|
||||
Accessibility.ForType(enumType),
|
||||
_code.Escape(enumType),
|
||||
_code.Escape(_typeMapper.UnderlyingClrType(enumType)));
|
||||
}
|
||||
|
||||
public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
|
||||
{
|
||||
var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
|
||||
{
|
||||
var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
|
||||
var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
|
||||
var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
|
||||
writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
|
||||
}
|
||||
}
|
||||
|
||||
public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} IQueryable<{1}> {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
_code.Escape(edmFunction),
|
||||
string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
|
||||
}
|
||||
|
||||
public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
edmFunction.NamespaceName,
|
||||
edmFunction.Name,
|
||||
string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
|
||||
_code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
|
||||
}
|
||||
|
||||
public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
|
||||
if (includeMergeOption)
|
||||
{
|
||||
paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
_code.Escape(edmFunction),
|
||||
paramList);
|
||||
}
|
||||
|
||||
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
|
||||
if (includeMergeOption)
|
||||
{
|
||||
callParams = ", mergeOption" + callParams;
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
|
||||
returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
edmFunction.Name,
|
||||
callParams);
|
||||
}
|
||||
|
||||
public string DbSet(EntitySet entitySet)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} virtual DbSet<{1}> {2} {{ get; set; }}",
|
||||
Accessibility.ForReadOnlyProperty(entitySet),
|
||||
_typeMapper.GetTypeName(entitySet.ElementType),
|
||||
_code.Escape(entitySet));
|
||||
}
|
||||
|
||||
public string DbSetInitializer(EntitySet entitySet)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} = Set<{1}>();",
|
||||
_code.Escape(entitySet),
|
||||
_typeMapper.GetTypeName(entitySet.ElementType));
|
||||
}
|
||||
|
||||
public string UsingDirectives(bool inHeader, bool includeCollections = true)
|
||||
{
|
||||
return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
|
||||
? string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}using System;{1}" +
|
||||
"{2}",
|
||||
inHeader ? Environment.NewLine : "",
|
||||
includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
|
||||
inHeader ? "" : Environment.NewLine)
|
||||
: "";
|
||||
}
|
||||
}
|
||||
|
||||
public class TypeMapper
|
||||
{
|
||||
private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
|
||||
|
||||
private readonly System.Collections.IList _errors;
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public static string FixNamespaces(string typeName)
|
||||
{
|
||||
return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
|
||||
}
|
||||
|
||||
public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
ArgumentNotNull(errors, "errors");
|
||||
|
||||
_code = code;
|
||||
_ef = ef;
|
||||
_errors = errors;
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, string modelNamespace)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
|
||||
{
|
||||
if (edmType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var collectionType = edmType as CollectionType;
|
||||
if (collectionType != null)
|
||||
{
|
||||
return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
|
||||
}
|
||||
|
||||
var typeName = _code.Escape(edmType.MetadataProperties
|
||||
.Where(p => p.Name == ExternalTypeNameAttributeName)
|
||||
.Select(p => (string)p.Value)
|
||||
.FirstOrDefault())
|
||||
?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
|
||||
_code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
|
||||
_code.Escape(edmType));
|
||||
|
||||
if (edmType is StructuralType)
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
if (edmType is SimpleType)
|
||||
{
|
||||
var clrType = UnderlyingClrType(edmType);
|
||||
if (!IsEnumType(edmType))
|
||||
{
|
||||
typeName = _code.Escape(clrType);
|
||||
}
|
||||
|
||||
typeName = FixNamespaces(typeName);
|
||||
|
||||
return clrType.IsValueType && isNullable == true ?
|
||||
String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
|
||||
typeName;
|
||||
}
|
||||
|
||||
throw new ArgumentException("edmType");
|
||||
}
|
||||
|
||||
public Type UnderlyingClrType(EdmType edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
var primitiveType = edmType as PrimitiveType;
|
||||
if (primitiveType != null)
|
||||
{
|
||||
return primitiveType.ClrEquivalentType;
|
||||
}
|
||||
|
||||
if (IsEnumType(edmType))
|
||||
{
|
||||
return GetEnumUnderlyingType(edmType).ClrEquivalentType;
|
||||
}
|
||||
|
||||
return typeof(object);
|
||||
}
|
||||
|
||||
public object GetEnumMemberValue(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var valueProperty = enumMember.GetType().GetProperty("Value");
|
||||
return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public string GetEnumMemberName(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var nameProperty = enumMember.GetType().GetProperty("Name");
|
||||
return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var membersProperty = enumType.GetType().GetProperty("Members");
|
||||
return membersProperty != null
|
||||
? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
|
||||
: Enumerable.Empty<MetadataItem>();
|
||||
}
|
||||
|
||||
public bool EnumIsFlags(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
|
||||
return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public bool IsEnumType(GlobalItem edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
return edmType.GetType().Name == "EnumType";
|
||||
}
|
||||
|
||||
public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public string CreateLiteral(object value)
|
||||
{
|
||||
if (value == null || value.GetType() != typeof(TimeSpan))
|
||||
{
|
||||
return _code.CreateLiteral(value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
|
||||
}
|
||||
|
||||
public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
|
||||
{
|
||||
ArgumentNotNull(types, "types");
|
||||
ArgumentNotNull(sourceFile, "sourceFile");
|
||||
|
||||
var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
if (types.Any(item => !hash.Add(item)))
|
||||
{
|
||||
_errors.Add(
|
||||
new CompilerError(sourceFile, -1, -1, "6023",
|
||||
String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return GetItemsToGenerate<SimpleType>(itemCollection)
|
||||
.Where(e => IsEnumType(e));
|
||||
}
|
||||
|
||||
public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
|
||||
{
|
||||
return itemCollection
|
||||
.OfType<T>()
|
||||
.Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
|
||||
.OrderBy(i => i.Name);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return itemCollection
|
||||
.Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
|
||||
.Select(g => GetGlobalItemName(g));
|
||||
}
|
||||
|
||||
public string GetGlobalItemName(GlobalItem item)
|
||||
{
|
||||
if (item is EdmType)
|
||||
{
|
||||
return ((EdmType)item).Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((EntityContainer)item).Name;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
|
||||
}
|
||||
|
||||
public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
|
||||
return returnParamsProperty == null
|
||||
? edmFunction.ReturnParameter
|
||||
: ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
|
||||
}
|
||||
|
||||
public bool IsComposable(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
|
||||
return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
|
||||
}
|
||||
|
||||
public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
|
||||
{
|
||||
return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
}
|
||||
|
||||
public TypeUsage GetReturnType(EdmFunction edmFunction)
|
||||
{
|
||||
var returnParam = GetReturnParameter(edmFunction);
|
||||
return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
|
||||
}
|
||||
|
||||
public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
|
||||
{
|
||||
var returnType = GetReturnType(edmFunction);
|
||||
return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ArgumentNotNull<T>(T arg, string name) where T : class
|
||||
{
|
||||
if (arg == null)
|
||||
{
|
||||
throw new ArgumentNullException(name);
|
||||
}
|
||||
}
|
||||
#>
|
||||
10
AUTS.Domain/Entities/ManageEntity.Designer.cs
generated
Normal file
10
AUTS.Domain/Entities/ManageEntity.Designer.cs
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
// 为模型“D:\NewGitRepos\AUTS-DATA\AUTS.Domain\Entities\ManageEntity.edmx”启用了 T4 代码生成。
|
||||
// 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值
|
||||
// 更改为“旧的 ObjectContext”。当在设计器中打开该模型时,此属性会出现在
|
||||
// “属性”窗口中。
|
||||
|
||||
// 如果没有生成任何上下文和实体类,可能是因为您创建了空模型但是
|
||||
// 尚未选择要使用的实体框架版本。要为您的模型生成一个上下文类和实体
|
||||
// 类,请在设计器中打开该模型,右键单击设计器图面,然后
|
||||
// 选择“从数据库更新模型...”、“从模型生成数据库...”或“添加代码生成
|
||||
// 项...”。
|
||||
9
AUTS.Domain/Entities/ManageEntity.cs
Normal file
9
AUTS.Domain/Entities/ManageEntity.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
1113
AUTS.Domain/Entities/ManageEntity.edmx
Normal file
1113
AUTS.Domain/Entities/ManageEntity.edmx
Normal file
File diff suppressed because it is too large
Load Diff
34
AUTS.Domain/Entities/ManageEntity.edmx.diagram
Normal file
34
AUTS.Domain/Entities/ManageEntity.edmx.diagram
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
|
||||
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
|
||||
<edmx:Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
|
||||
<!-- Diagram content (shape and connector positions) -->
|
||||
<edmx:Diagrams>
|
||||
<Diagram DiagramId="60616cae545046229af779a4fe88eb80" Name="Diagram1" ZoomLevel="64">
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_TestPlanTips" Width="1.5" PointX="2.375" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_ServiceLog" Width="1.5" PointX="6" PointY="2.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_ErrCode" Width="1.5" PointX="6" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_AuthManage" Width="1.5" PointX="2.25" PointY="3.625" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_Module" Width="1.5" PointX="0.5" PointY="3.625" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_AppList" Width="1.5" PointX="0.75" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_AppLog" Width="1.5" PointX="4.125" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_DataServiceList" PointX="6.375" PointY="12.75" Width="2.25" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_DataServiceLog" Width="1.5" PointX="8" PointY="6.5" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_DevLog" Width="1.5" PointX="10.25" PointY="5.5" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_LicenseList" Width="1.5" PointX="8" PointY="1" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_Log" Width="1.5" PointX="10.25" PointY="3.125" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_SearchKey" Width="1.5" PointX="5.5" PointY="9.375" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_SwReleaseLog" Width="1.5" PointX="4.125" PointY="6.125" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_SwUpdate" Width="1.5" PointX="2" PointY="6.5" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_SyncList" Width="1.5" PointX="0.5" PointY="10.625" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_User" Width="2.375" PointX="2.625" PointY="9.875" IsExpanded="true" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_UserAuth_Operation" Width="1.5" PointX="7.875" PointY="3.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_UtsCmdList" Width="1.5" PointX="12.25" PointY="0.75" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_AuthLog" Width="1.5" PointX="10.25" PointY="0.875" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_OrderStatus" Width="1.5" PointX="7.875" PointY="9.625" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_DBList" Width="1.5" PointX="9.625" PointY="9.625" />
|
||||
<EntityTypeShape EntityType="Uts_ManageModel.TBL_UTS_Manage_Company" Width="1.5" PointX="5.5" PointY="11.5" />
|
||||
</Diagram>
|
||||
</edmx:Diagrams>
|
||||
</edmx:Designer>
|
||||
</edmx:Edmx>
|
||||
733
AUTS.Domain/Entities/ManageEntity.tt
Normal file
733
AUTS.Domain/Entities/ManageEntity.tt
Normal file
@@ -0,0 +1,733 @@
|
||||
<#@ template language="C#" debug="false" hostspecific="true"#>
|
||||
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
|
||||
output extension=".cs"#><#
|
||||
|
||||
const string inputFile = @"ManageEntity.edmx";
|
||||
var textTransform = DynamicTextTransformation.Create(this);
|
||||
var code = new CodeGenerationTools(this);
|
||||
var ef = new MetadataTools(this);
|
||||
var typeMapper = new TypeMapper(code, ef, textTransform.Errors);
|
||||
var fileManager = EntityFrameworkTemplateFileManager.Create(this);
|
||||
var itemCollection = new EdmMetadataLoader(textTransform.Host, textTransform.Errors).CreateEdmItemCollection(inputFile);
|
||||
var codeStringGenerator = new CodeStringGenerator(code, typeMapper, ef);
|
||||
|
||||
if (!typeMapper.VerifyCaseInsensitiveTypeUniqueness(typeMapper.GetAllGlobalItems(itemCollection), inputFile))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
WriteHeader(codeStringGenerator, fileManager);
|
||||
|
||||
foreach (var entity in typeMapper.GetItemsToGenerate<EntityType>(itemCollection))
|
||||
{
|
||||
fileManager.StartNewFile(entity.Name + ".cs");
|
||||
BeginNamespace(code);
|
||||
#>
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: false)#>
|
||||
<#=codeStringGenerator.EntityClassOpening(entity)#>
|
||||
{
|
||||
<#
|
||||
var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(entity);
|
||||
var collectionNavigationProperties = typeMapper.GetCollectionNavigationProperties(entity);
|
||||
var complexProperties = typeMapper.GetComplexProperties(entity);
|
||||
|
||||
if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
|
||||
public <#=code.Escape(entity)#>()
|
||||
{
|
||||
<#
|
||||
foreach (var edmProperty in propertiesWithDefaultValues)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var navigationProperty in collectionNavigationProperties)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=typeMapper.GetTypeName(navigationProperty.ToEndMember.GetEntityType())#>>();
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var complexProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
|
||||
<#
|
||||
}
|
||||
#>
|
||||
}
|
||||
|
||||
<#
|
||||
}
|
||||
|
||||
var simpleProperties = typeMapper.GetSimpleProperties(entity);
|
||||
if (simpleProperties.Any())
|
||||
{
|
||||
foreach (var edmProperty in simpleProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(edmProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
|
||||
if (complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
|
||||
<#
|
||||
foreach(var complexProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(complexProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
|
||||
var navigationProperties = typeMapper.GetNavigationProperties(entity);
|
||||
if (navigationProperties.Any())
|
||||
{
|
||||
#>
|
||||
|
||||
<#
|
||||
foreach (var navigationProperty in navigationProperties)
|
||||
{
|
||||
if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many)
|
||||
{
|
||||
#>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#=codeStringGenerator.NavigationProperty(navigationProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
EndNamespace(code);
|
||||
}
|
||||
|
||||
foreach (var complex in typeMapper.GetItemsToGenerate<ComplexType>(itemCollection))
|
||||
{
|
||||
fileManager.StartNewFile(complex.Name + ".cs");
|
||||
BeginNamespace(code);
|
||||
#>
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
|
||||
<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#>
|
||||
{
|
||||
<#
|
||||
var complexProperties = typeMapper.GetComplexProperties(complex);
|
||||
var propertiesWithDefaultValues = typeMapper.GetPropertiesWithDefaultValues(complex);
|
||||
|
||||
if (propertiesWithDefaultValues.Any() || complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
public <#=code.Escape(complex)#>()
|
||||
{
|
||||
<#
|
||||
foreach (var edmProperty in propertiesWithDefaultValues)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(edmProperty)#> = <#=typeMapper.CreateLiteral(edmProperty.DefaultValue)#>;
|
||||
<#
|
||||
}
|
||||
|
||||
foreach (var complexProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
this.<#=code.Escape(complexProperty)#> = new <#=typeMapper.GetTypeName(complexProperty.TypeUsage)#>();
|
||||
<#
|
||||
}
|
||||
#>
|
||||
}
|
||||
|
||||
<#
|
||||
}
|
||||
|
||||
var simpleProperties = typeMapper.GetSimpleProperties(complex);
|
||||
if (simpleProperties.Any())
|
||||
{
|
||||
foreach(var edmProperty in simpleProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(edmProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
|
||||
if (complexProperties.Any())
|
||||
{
|
||||
#>
|
||||
|
||||
<#
|
||||
foreach(var edmProperty in complexProperties)
|
||||
{
|
||||
#>
|
||||
<#=codeStringGenerator.Property(edmProperty)#>
|
||||
<#
|
||||
}
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
EndNamespace(code);
|
||||
}
|
||||
|
||||
foreach (var enumType in typeMapper.GetEnumItemsToGenerate(itemCollection))
|
||||
{
|
||||
fileManager.StartNewFile(enumType.Name + ".cs");
|
||||
BeginNamespace(code);
|
||||
#>
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: false, includeCollections: false)#>
|
||||
<#
|
||||
if (typeMapper.EnumIsFlags(enumType))
|
||||
{
|
||||
#>
|
||||
[Flags]
|
||||
<#
|
||||
}
|
||||
#>
|
||||
<#=codeStringGenerator.EnumOpening(enumType)#>
|
||||
{
|
||||
<#
|
||||
var foundOne = false;
|
||||
|
||||
foreach (MetadataItem member in typeMapper.GetEnumMembers(enumType))
|
||||
{
|
||||
foundOne = true;
|
||||
#>
|
||||
<#=code.Escape(typeMapper.GetEnumMemberName(member))#> = <#=typeMapper.GetEnumMemberValue(member)#>,
|
||||
<#
|
||||
}
|
||||
|
||||
if (foundOne)
|
||||
{
|
||||
this.GenerationEnvironment.Remove(this.GenerationEnvironment.Length - 3, 1);
|
||||
}
|
||||
#>
|
||||
}
|
||||
<#
|
||||
EndNamespace(code);
|
||||
}
|
||||
|
||||
fileManager.Process();
|
||||
|
||||
#>
|
||||
<#+
|
||||
|
||||
public void WriteHeader(CodeStringGenerator codeStringGenerator, EntityFrameworkTemplateFileManager fileManager)
|
||||
{
|
||||
fileManager.StartHeader();
|
||||
#>
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#>
|
||||
//
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#>
|
||||
// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#>
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
<#=codeStringGenerator.UsingDirectives(inHeader: true)#>
|
||||
<#+
|
||||
fileManager.EndBlock();
|
||||
}
|
||||
|
||||
public void BeginNamespace(CodeGenerationTools code)
|
||||
{
|
||||
var codeNamespace = code.VsNamespaceSuggestion();
|
||||
if (!String.IsNullOrEmpty(codeNamespace))
|
||||
{
|
||||
#>
|
||||
namespace <#=code.EscapeNamespace(codeNamespace)#>
|
||||
{
|
||||
<#+
|
||||
PushIndent(" ");
|
||||
}
|
||||
}
|
||||
|
||||
public void EndNamespace(CodeGenerationTools code)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(code.VsNamespaceSuggestion()))
|
||||
{
|
||||
PopIndent();
|
||||
#>
|
||||
}
|
||||
<#+
|
||||
}
|
||||
}
|
||||
|
||||
public const string TemplateId = "CSharp_DbContext_Types_EF6";
|
||||
|
||||
public class CodeStringGenerator
|
||||
{
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly TypeMapper _typeMapper;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public CodeStringGenerator(CodeGenerationTools code, TypeMapper typeMapper, MetadataTools ef)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(typeMapper, "typeMapper");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
|
||||
_code = code;
|
||||
_typeMapper = typeMapper;
|
||||
_ef = ef;
|
||||
}
|
||||
|
||||
public string Property(EdmProperty edmProperty)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
Accessibility.ForProperty(edmProperty),
|
||||
_typeMapper.GetTypeName(edmProperty.TypeUsage),
|
||||
_code.Escape(edmProperty),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(edmProperty)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(edmProperty)));
|
||||
}
|
||||
|
||||
public string NavigationProperty(NavigationProperty navProp)
|
||||
{
|
||||
var endType = _typeMapper.GetTypeName(navProp.ToEndMember.GetEntityType());
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2} {{ {3}get; {4}set; }}",
|
||||
AccessibilityAndVirtual(Accessibility.ForNavigationProperty(navProp)),
|
||||
navProp.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType,
|
||||
_code.Escape(navProp),
|
||||
_code.SpaceAfter(Accessibility.ForGetter(navProp)),
|
||||
_code.SpaceAfter(Accessibility.ForSetter(navProp)));
|
||||
}
|
||||
|
||||
public string AccessibilityAndVirtual(string accessibility)
|
||||
{
|
||||
return accessibility + (accessibility != "private" ? " virtual" : "");
|
||||
}
|
||||
|
||||
public string EntityClassOpening(EntityType entity)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1}partial class {2}{3}",
|
||||
Accessibility.ForType(entity),
|
||||
_code.SpaceAfter(_code.AbstractOption(entity)),
|
||||
_code.Escape(entity),
|
||||
_code.StringBefore(" : ", _typeMapper.GetTypeName(entity.BaseType)));
|
||||
}
|
||||
|
||||
public string EnumOpening(SimpleType enumType)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} enum {1} : {2}",
|
||||
Accessibility.ForType(enumType),
|
||||
_code.Escape(enumType),
|
||||
_code.Escape(_typeMapper.UnderlyingClrType(enumType)));
|
||||
}
|
||||
|
||||
public void WriteFunctionParameters(EdmFunction edmFunction, Action<string, string, string, string> writeParameter)
|
||||
{
|
||||
var parameters = FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable))
|
||||
{
|
||||
var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null";
|
||||
var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")";
|
||||
var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + TypeMapper.FixNamespaces(parameter.RawClrTypeName) + "))";
|
||||
writeParameter(parameter.LocalVariableName, isNotNull, notNullInit, nullInit);
|
||||
}
|
||||
}
|
||||
|
||||
public string ComposableFunctionMethod(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} IQueryable<{1}> {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
_code.Escape(edmFunction),
|
||||
string.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray()));
|
||||
}
|
||||
|
||||
public string ComposableCreateQuery(EdmFunction edmFunction, string modelNamespace)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.CreateQuery<{0}>(\"[{1}].[{2}]({3})\"{4});",
|
||||
_typeMapper.GetTypeName(_typeMapper.GetReturnType(edmFunction), modelNamespace),
|
||||
edmFunction.NamespaceName,
|
||||
edmFunction.Name,
|
||||
string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray()),
|
||||
_code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())));
|
||||
}
|
||||
|
||||
public string FunctionMethod(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var paramList = String.Join(", ", parameters.Select(p => TypeMapper.FixNamespaces(p.FunctionParameterType) + " " + p.FunctionParameterName).ToArray());
|
||||
if (includeMergeOption)
|
||||
{
|
||||
paramList = _code.StringAfter(paramList, ", ") + "MergeOption mergeOption";
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} {1} {2}({3})",
|
||||
AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction)),
|
||||
returnType == null ? "int" : "ObjectResult<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
_code.Escape(edmFunction),
|
||||
paramList);
|
||||
}
|
||||
|
||||
public string ExecuteFunction(EdmFunction edmFunction, string modelNamespace, bool includeMergeOption)
|
||||
{
|
||||
var parameters = _typeMapper.GetParameters(edmFunction);
|
||||
var returnType = _typeMapper.GetReturnType(edmFunction);
|
||||
|
||||
var callParams = _code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()));
|
||||
if (includeMergeOption)
|
||||
{
|
||||
callParams = ", mergeOption" + callParams;
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction{0}(\"{1}\"{2});",
|
||||
returnType == null ? "" : "<" + _typeMapper.GetTypeName(returnType, modelNamespace) + ">",
|
||||
edmFunction.Name,
|
||||
callParams);
|
||||
}
|
||||
|
||||
public string DbSet(EntitySet entitySet)
|
||||
{
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0} virtual DbSet<{1}> {2} {{ get; set; }}",
|
||||
Accessibility.ForReadOnlyProperty(entitySet),
|
||||
_typeMapper.GetTypeName(entitySet.ElementType),
|
||||
_code.Escape(entitySet));
|
||||
}
|
||||
|
||||
public string UsingDirectives(bool inHeader, bool includeCollections = true)
|
||||
{
|
||||
return inHeader == string.IsNullOrEmpty(_code.VsNamespaceSuggestion())
|
||||
? string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}using System;{1}" +
|
||||
"{2}",
|
||||
inHeader ? Environment.NewLine : "",
|
||||
includeCollections ? (Environment.NewLine + "using System.Collections.Generic;") : "",
|
||||
inHeader ? "" : Environment.NewLine)
|
||||
: "";
|
||||
}
|
||||
}
|
||||
|
||||
public class TypeMapper
|
||||
{
|
||||
private const string ExternalTypeNameAttributeName = @"http://schemas.microsoft.com/ado/2006/04/codegeneration:ExternalTypeName";
|
||||
|
||||
private readonly System.Collections.IList _errors;
|
||||
private readonly CodeGenerationTools _code;
|
||||
private readonly MetadataTools _ef;
|
||||
|
||||
public TypeMapper(CodeGenerationTools code, MetadataTools ef, System.Collections.IList errors)
|
||||
{
|
||||
ArgumentNotNull(code, "code");
|
||||
ArgumentNotNull(ef, "ef");
|
||||
ArgumentNotNull(errors, "errors");
|
||||
|
||||
_code = code;
|
||||
_ef = ef;
|
||||
_errors = errors;
|
||||
}
|
||||
|
||||
public static string FixNamespaces(string typeName)
|
||||
{
|
||||
return typeName.Replace("System.Data.Spatial.", "System.Data.Entity.Spatial.");
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: null);
|
||||
}
|
||||
|
||||
public string GetTypeName(TypeUsage typeUsage, string modelNamespace)
|
||||
{
|
||||
return typeUsage == null ? null : GetTypeName(typeUsage.EdmType, _ef.IsNullable(typeUsage), modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, string modelNamespace)
|
||||
{
|
||||
return GetTypeName(edmType, isNullable: null, modelNamespace: modelNamespace);
|
||||
}
|
||||
|
||||
public string GetTypeName(EdmType edmType, bool? isNullable, string modelNamespace)
|
||||
{
|
||||
if (edmType == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var collectionType = edmType as CollectionType;
|
||||
if (collectionType != null)
|
||||
{
|
||||
return String.Format(CultureInfo.InvariantCulture, "ICollection<{0}>", GetTypeName(collectionType.TypeUsage, modelNamespace));
|
||||
}
|
||||
|
||||
var typeName = _code.Escape(edmType.MetadataProperties
|
||||
.Where(p => p.Name == ExternalTypeNameAttributeName)
|
||||
.Select(p => (string)p.Value)
|
||||
.FirstOrDefault())
|
||||
?? (modelNamespace != null && edmType.NamespaceName != modelNamespace ?
|
||||
_code.CreateFullName(_code.EscapeNamespace(edmType.NamespaceName), _code.Escape(edmType)) :
|
||||
_code.Escape(edmType));
|
||||
|
||||
if (edmType is StructuralType)
|
||||
{
|
||||
return typeName;
|
||||
}
|
||||
|
||||
if (edmType is SimpleType)
|
||||
{
|
||||
var clrType = UnderlyingClrType(edmType);
|
||||
if (!IsEnumType(edmType))
|
||||
{
|
||||
typeName = _code.Escape(clrType);
|
||||
}
|
||||
|
||||
typeName = FixNamespaces(typeName);
|
||||
|
||||
return clrType.IsValueType && isNullable == true ?
|
||||
String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName) :
|
||||
typeName;
|
||||
}
|
||||
|
||||
throw new ArgumentException("edmType");
|
||||
}
|
||||
|
||||
public Type UnderlyingClrType(EdmType edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
var primitiveType = edmType as PrimitiveType;
|
||||
if (primitiveType != null)
|
||||
{
|
||||
return primitiveType.ClrEquivalentType;
|
||||
}
|
||||
|
||||
if (IsEnumType(edmType))
|
||||
{
|
||||
return GetEnumUnderlyingType(edmType).ClrEquivalentType;
|
||||
}
|
||||
|
||||
return typeof(object);
|
||||
}
|
||||
|
||||
public object GetEnumMemberValue(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var valueProperty = enumMember.GetType().GetProperty("Value");
|
||||
return valueProperty == null ? null : valueProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public string GetEnumMemberName(MetadataItem enumMember)
|
||||
{
|
||||
ArgumentNotNull(enumMember, "enumMember");
|
||||
|
||||
var nameProperty = enumMember.GetType().GetProperty("Name");
|
||||
return nameProperty == null ? null : (string)nameProperty.GetValue(enumMember, null);
|
||||
}
|
||||
|
||||
public System.Collections.IEnumerable GetEnumMembers(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var membersProperty = enumType.GetType().GetProperty("Members");
|
||||
return membersProperty != null
|
||||
? (System.Collections.IEnumerable)membersProperty.GetValue(enumType, null)
|
||||
: Enumerable.Empty<MetadataItem>();
|
||||
}
|
||||
|
||||
public bool EnumIsFlags(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
var isFlagsProperty = enumType.GetType().GetProperty("IsFlags");
|
||||
return isFlagsProperty != null && (bool)isFlagsProperty.GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public bool IsEnumType(GlobalItem edmType)
|
||||
{
|
||||
ArgumentNotNull(edmType, "edmType");
|
||||
|
||||
return edmType.GetType().Name == "EnumType";
|
||||
}
|
||||
|
||||
public PrimitiveType GetEnumUnderlyingType(EdmType enumType)
|
||||
{
|
||||
ArgumentNotNull(enumType, "enumType");
|
||||
|
||||
return (PrimitiveType)enumType.GetType().GetProperty("UnderlyingType").GetValue(enumType, null);
|
||||
}
|
||||
|
||||
public string CreateLiteral(object value)
|
||||
{
|
||||
if (value == null || value.GetType() != typeof(TimeSpan))
|
||||
{
|
||||
return _code.CreateLiteral(value);
|
||||
}
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "new TimeSpan({0})", ((TimeSpan)value).Ticks);
|
||||
}
|
||||
|
||||
public bool VerifyCaseInsensitiveTypeUniqueness(IEnumerable<string> types, string sourceFile)
|
||||
{
|
||||
ArgumentNotNull(types, "types");
|
||||
ArgumentNotNull(sourceFile, "sourceFile");
|
||||
|
||||
var hash = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
||||
if (types.Any(item => !hash.Add(item)))
|
||||
{
|
||||
_errors.Add(
|
||||
new CompilerError(sourceFile, -1, -1, "6023",
|
||||
String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CaseInsensitiveTypeConflict"))));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public IEnumerable<SimpleType> GetEnumItemsToGenerate(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return GetItemsToGenerate<SimpleType>(itemCollection)
|
||||
.Where(e => IsEnumType(e));
|
||||
}
|
||||
|
||||
public IEnumerable<T> GetItemsToGenerate<T>(IEnumerable<GlobalItem> itemCollection) where T: EdmType
|
||||
{
|
||||
return itemCollection
|
||||
.OfType<T>()
|
||||
.Where(i => !i.MetadataProperties.Any(p => p.Name == ExternalTypeNameAttributeName))
|
||||
.OrderBy(i => i.Name);
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetAllGlobalItems(IEnumerable<GlobalItem> itemCollection)
|
||||
{
|
||||
return itemCollection
|
||||
.Where(i => i is EntityType || i is ComplexType || i is EntityContainer || IsEnumType(i))
|
||||
.Select(g => GetGlobalItemName(g));
|
||||
}
|
||||
|
||||
public string GetGlobalItemName(GlobalItem item)
|
||||
{
|
||||
if (item is EdmType)
|
||||
{
|
||||
return ((EdmType)item).Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ((EntityContainer)item).Name;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetSimpleProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetComplexProperties(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(EntityType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<EdmProperty> GetPropertiesWithDefaultValues(ComplexType type)
|
||||
{
|
||||
return type.Properties.Where(p => p.TypeUsage.EdmType is SimpleType && p.DeclaringType == type && p.DefaultValue != null);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type);
|
||||
}
|
||||
|
||||
public IEnumerable<NavigationProperty> GetCollectionNavigationProperties(EntityType type)
|
||||
{
|
||||
return type.NavigationProperties.Where(np => np.DeclaringType == type && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many);
|
||||
}
|
||||
|
||||
public FunctionParameter GetReturnParameter(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var returnParamsProperty = edmFunction.GetType().GetProperty("ReturnParameters");
|
||||
return returnParamsProperty == null
|
||||
? edmFunction.ReturnParameter
|
||||
: ((IEnumerable<FunctionParameter>)returnParamsProperty.GetValue(edmFunction, null)).FirstOrDefault();
|
||||
}
|
||||
|
||||
public bool IsComposable(EdmFunction edmFunction)
|
||||
{
|
||||
ArgumentNotNull(edmFunction, "edmFunction");
|
||||
|
||||
var isComposableProperty = edmFunction.GetType().GetProperty("IsComposableAttribute");
|
||||
return isComposableProperty != null && (bool)isComposableProperty.GetValue(edmFunction, null);
|
||||
}
|
||||
|
||||
public IEnumerable<FunctionImportParameter> GetParameters(EdmFunction edmFunction)
|
||||
{
|
||||
return FunctionImportParameter.Create(edmFunction.Parameters, _code, _ef);
|
||||
}
|
||||
|
||||
public TypeUsage GetReturnType(EdmFunction edmFunction)
|
||||
{
|
||||
var returnParam = GetReturnParameter(edmFunction);
|
||||
return returnParam == null ? null : _ef.GetElementType(returnParam.TypeUsage);
|
||||
}
|
||||
|
||||
public bool GenerateMergeOptionFunction(EdmFunction edmFunction, bool includeMergeOption)
|
||||
{
|
||||
var returnType = GetReturnType(edmFunction);
|
||||
return !includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ArgumentNotNull<T>(T arg, string name) where T : class
|
||||
{
|
||||
if (arg == null)
|
||||
{
|
||||
throw new ArgumentNullException(name);
|
||||
}
|
||||
}
|
||||
#>
|
||||
99
AUTS.Domain/Entities/SqlSugarBase.cs
Normal file
99
AUTS.Domain/Entities/SqlSugarBase.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
public class SqlSugarBase
|
||||
{
|
||||
public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
DbType = SqlSugar.DbType.MySql,
|
||||
ConnectionString = "Server=blv-rd.tech;Database=uts_manage;Uid=uts_manager;Pwd=WoUts*#082k;charset=utf8;port=3307;",
|
||||
IsAutoCloseConnection = true
|
||||
},
|
||||
db =>
|
||||
{
|
||||
//db.DbMaintenance.CreateDatabase(); //个别数据库不支持
|
||||
//Type[] types = Assembly
|
||||
//.LoadFrom($@"D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\cxwMin\cxw\AUTS.Web\bin\AUTS.Domain.dll")//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
|
||||
//.GetTypes().Where(it => it.FullName.Contains("AUTS.Domain.CxwAll."))//命名空间过滤,当然你也可以写其他条件过滤
|
||||
//.ToArray();//断点调试一下是不是需要的Type,不是需要的在进行过滤
|
||||
//db.CodeFirst.SetStringDefaultLength(200).InitTables(types);//根据types创建表
|
||||
//单例参数配置,所有上下文生效
|
||||
db.Aop.OnLogExecuting = (s, p) =>
|
||||
{
|
||||
Debug.WriteLine(s);
|
||||
};
|
||||
});
|
||||
|
||||
public static SqlSugarScope DbZongQing = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
DbType = SqlSugar.DbType.MySql,
|
||||
ConnectionString = "Server=blv-rd.tech;Database=uts_ZongQing;Uid=uts_manager;Pwd=WoUts*#082k;charset=utf8;port=3307;",
|
||||
IsAutoCloseConnection = true
|
||||
},
|
||||
db =>
|
||||
{
|
||||
//db.DbMaintenance.CreateDatabase(); //个别数据库不支持
|
||||
//Type[] types = Assembly
|
||||
//.LoadFrom($@"D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\cxwMin\cxw\AUTS.Web\bin\AUTS.Domain.dll")//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
|
||||
//.GetTypes().Where(it => it.FullName.Contains("AUTS.Domain.CxwAll."))//命名空间过滤,当然你也可以写其他条件过滤
|
||||
//.ToArray();//断点调试一下是不是需要的Type,不是需要的在进行过滤
|
||||
//db.CodeFirst.SetStringDefaultLength(200).InitTables(types);//根据types创建表
|
||||
//单例参数配置,所有上下文生效
|
||||
db.Aop.OnLogExecuting = (s, p) =>
|
||||
{
|
||||
Debug.WriteLine(s);
|
||||
};
|
||||
});
|
||||
|
||||
public static SqlSugarScope DbZongQingClone = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
DbType = SqlSugar.DbType.MySql,
|
||||
ConnectionString = "Server=db.uts-data.com;Database=uts_ZongQing;Uid=uts_manager;Pwd=WoUts*#082k;charset=utf8;port=3307;",
|
||||
IsAutoCloseConnection = true
|
||||
},
|
||||
db =>
|
||||
{
|
||||
//db.DbMaintenance.CreateDatabase(); //个别数据库不支持
|
||||
//Type[] types = Assembly
|
||||
//.LoadFrom($@"D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\cxwMin\cxw\AUTS.Web\bin\AUTS.Domain.dll")//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
|
||||
//.GetTypes().Where(it => it.FullName.Contains("AUTS.Domain.CxwAll."))//命名空间过滤,当然你也可以写其他条件过滤
|
||||
//.ToArray();//断点调试一下是不是需要的Type,不是需要的在进行过滤
|
||||
//db.CodeFirst.SetStringDefaultLength(200).InitTables(types);//根据types创建表
|
||||
//单例参数配置,所有上下文生效
|
||||
db.Aop.OnLogExecuting = (s, p) =>
|
||||
{
|
||||
Debug.WriteLine(s);
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
public static SqlSugarScope ClientDb = new SqlSugarScope(new ConnectionConfig()
|
||||
{
|
||||
DbType = SqlSugar.DbType.MySql,
|
||||
ConnectionString = "Server=blv-cloud-db.mysql.rds.aliyuncs.com;Database=uts_db;Uid=blv_rcu;Pwd=fnadiaJDIJ7546;charset=utf8;port=3307",
|
||||
IsAutoCloseConnection = true
|
||||
},
|
||||
db =>
|
||||
{
|
||||
//db.DbMaintenance.CreateDatabase(); //个别数据库不支持
|
||||
//Type[] types = Assembly
|
||||
//.LoadFrom($@"D:\BLV_SYNC\RD_WEB\SynologyDrive\欧阳磊\cxwMin\cxw\AUTS.Web\bin\AUTS.Domain.dll")//如果 .dll报错,可以换成 xxx.exe 有些生成的是exe
|
||||
//.GetTypes().Where(it => it.FullName.Contains("AUTS.Domain.CxwAll."))//命名空间过滤,当然你也可以写其他条件过滤
|
||||
//.ToArray();//断点调试一下是不是需要的Type,不是需要的在进行过滤
|
||||
//db.CodeFirst.SetStringDefaultLength(200).InitTables(types);//根据types创建表
|
||||
//单例参数配置,所有上下文生效
|
||||
db.Aop.OnLogExecuting = (s, p) =>
|
||||
{
|
||||
Debug.WriteLine(s);
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_Customer.cs
Normal file
22
AUTS.Domain/Entities/TBL_Customer.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_Customer
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string CustomerAbbr { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_FlowCtr.cs
Normal file
22
AUTS.Domain/Entities/TBL_FlowCtr.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_FlowCtr
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> ProjectID { get; set; }
|
||||
public string SUT_SN { get; set; }
|
||||
public string ProcessRecord { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_Log.cs
Normal file
22
AUTS.Domain/Entities/TBL_Log.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_Log
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> UserID { get; set; }
|
||||
public Nullable<System.DateTime> DateTime { get; set; }
|
||||
public string Operation { get; set; }
|
||||
}
|
||||
}
|
||||
31
AUTS.Domain/Entities/TBL_OrderInternal.cs
Normal file
31
AUTS.Domain/Entities/TBL_OrderInternal.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_OrderInternal
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public string InternalNo { get; set; }
|
||||
public Nullable<int> CompanyID { get; set; }
|
||||
public Nullable<int> ProductID { get; set; }
|
||||
public Nullable<int> ProductTypeID { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
public int ObjectiveYield { get; set; }
|
||||
public int ObjectiveYieldTotal { get; set; }
|
||||
public Nullable<int> OrderStatus { get; set; }
|
||||
public Nullable<System.DateTime> DeliveryTime { get; set; }
|
||||
public string Station { get; set; }
|
||||
public string BarCode { get; set; }
|
||||
}
|
||||
}
|
||||
29
AUTS.Domain/Entities/TBL_Orders.cs
Normal file
29
AUTS.Domain/Entities/TBL_Orders.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_Orders
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int CompanyID { get; set; }
|
||||
public int ProductID { get; set; }
|
||||
public int ProductTypeID { get; set; }
|
||||
public string OrderNo { get; set; }
|
||||
public int OrderCount { get; set; }
|
||||
public System.DateTime DeliveryTime { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
public float CostPrice { get; set; }
|
||||
public float TransactPrice { get; set; }
|
||||
public int OrderStatus { get; set; }
|
||||
}
|
||||
}
|
||||
21
AUTS.Domain/Entities/TBL_ProductTypes.cs
Normal file
21
AUTS.Domain/Entities/TBL_ProductTypes.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_ProductTypes
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string ProductType { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_ProductionLine.cs
Normal file
22
AUTS.Domain/Entities/TBL_ProductionLine.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_ProductionLine
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
30
AUTS.Domain/Entities/TBL_ProductionPlan.cs
Normal file
30
AUTS.Domain/Entities/TBL_ProductionPlan.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_ProductionPlan
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public int ProductionLineID { get; set; }
|
||||
public System.DateTime ProductionTime { get; set; }
|
||||
public int ActualOutput { get; set; }
|
||||
public int ObjectiveYield { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public string Sn_Start { get; set; }
|
||||
public string Sn_End { get; set; }
|
||||
public int OrderInternalID { get; set; }
|
||||
public int ObjectiveYieldTotal { get; set; }
|
||||
public int StationID { get; set; }
|
||||
}
|
||||
}
|
||||
33
AUTS.Domain/Entities/TBL_Project.cs
Normal file
33
AUTS.Domain/Entities/TBL_Project.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_Project
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> ProductTypeID { get; set; }
|
||||
public string ProjectName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public Nullable<int> UserID { get; set; }
|
||||
public Nullable<System.DateTime> CreateTime { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public byte[] PreviewImage { get; set; }
|
||||
public Nullable<float> Price { get; set; }
|
||||
public string Currency { get; set; }
|
||||
public Nullable<sbyte> IsValid { get; set; }
|
||||
public Nullable<System.DateTime> EolDate { get; set; }
|
||||
public string ImageName { get; set; }
|
||||
public Nullable<int> Type { get; set; }
|
||||
public Nullable<int> SnType { get; set; }
|
||||
}
|
||||
}
|
||||
44
AUTS.Domain/Entities/TBL_RepairRequest.cs
Normal file
44
AUTS.Domain/Entities/TBL_RepairRequest.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_RepairRequest
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public string RepairRequestNum { get; set; }
|
||||
public int ProductID { get; set; }
|
||||
public string Barcode { get; set; }
|
||||
public string ProductImage { get; set; }
|
||||
public string RejectSource { get; set; }
|
||||
public string RejectCode { get; set; }
|
||||
public string RejectDesc { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
public System.DateTime UpdateTime { get; set; }
|
||||
public string RepairProgress { get; set; }
|
||||
public int RepairResult { get; set; }
|
||||
public int RepairLogID { get; set; }
|
||||
public int Repairier { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public string DetailRemark { get; set; }
|
||||
public int Statement { get; set; }
|
||||
//public string ProductMarking { get; set; }
|
||||
|
||||
public int Payer { get; set; }
|
||||
|
||||
public int Storage { get; set; }
|
||||
|
||||
public string Salesman { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
52
AUTS.Domain/Entities/TBL_SnList.cs
Normal file
52
AUTS.Domain/Entities/TBL_SnList.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_SnList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public int OrderInternalID { get; set; }
|
||||
public int ProductID { get; set; }
|
||||
public string BarCode { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
public Nullable<System.DateTime> S1 { get; set; }
|
||||
public Nullable<System.DateTime> S2 { get; set; }
|
||||
public Nullable<System.DateTime> S3 { get; set; }
|
||||
public Nullable<System.DateTime> S4 { get; set; }
|
||||
public Nullable<System.DateTime> S5 { get; set; }
|
||||
public Nullable<System.DateTime> S6 { get; set; }
|
||||
public Nullable<System.DateTime> S7 { get; set; }
|
||||
public Nullable<System.DateTime> S8 { get; set; }
|
||||
public Nullable<System.DateTime> S9 { get; set; }
|
||||
public Nullable<System.DateTime> S10 { get; set; }
|
||||
public Nullable<System.DateTime> S11 { get; set; }
|
||||
public Nullable<System.DateTime> S12 { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
public Nullable<sbyte> Result1 { get; set; }
|
||||
public Nullable<sbyte> Result2 { get; set; }
|
||||
public Nullable<sbyte> Result3 { get; set; }
|
||||
public Nullable<sbyte> Result4 { get; set; }
|
||||
public Nullable<sbyte> Result5 { get; set; }
|
||||
public Nullable<sbyte> Result6 { get; set; }
|
||||
public Nullable<sbyte> Result7 { get; set; }
|
||||
public Nullable<sbyte> Result8 { get; set; }
|
||||
public Nullable<sbyte> Result9 { get; set; }
|
||||
public Nullable<sbyte> Result10 { get; set; }
|
||||
public Nullable<sbyte> Result11 { get; set; }
|
||||
public Nullable<sbyte> Result12 { get; set; }
|
||||
public Nullable<int> SnType { get; set; }
|
||||
public string AssemblySn { get; set; }
|
||||
public Nullable<System.DateTime> AssemblyTime { get; set; }
|
||||
}
|
||||
}
|
||||
27
AUTS.Domain/Entities/TBL_SnRules.cs
Normal file
27
AUTS.Domain/Entities/TBL_SnRules.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_SnRules
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int OrderID { get; set; }
|
||||
public int OrderInternalID { get; set; }
|
||||
public int ProductID { get; set; }
|
||||
public string StationIDs { get; set; }
|
||||
public string Sn_Prefix { get; set; }
|
||||
public string Sn_Start { get; set; }
|
||||
public string Sn_End { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
37
AUTS.Domain/Entities/TBL_StationList.cs
Normal file
37
AUTS.Domain/Entities/TBL_StationList.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_StationList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int ProjectID { get; set; }
|
||||
public string StationName { get; set; }
|
||||
public string StationType { get; set; }
|
||||
public int ArtworkOrder { get; set; }
|
||||
public string StationDesc { get; set; }
|
||||
public Nullable<System.DateTime> LastUpdateDate { get; set; }
|
||||
public string LogTableName { get; set; }
|
||||
public byte[] BinPackage { get; set; }
|
||||
public string BinPackageMd5 { get; set; }
|
||||
public byte[] PreviewImage { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public string PacketName { get; set; }
|
||||
public Nullable<int> SnListOrder { get; set; }
|
||||
public Nullable<sbyte> IsValid { get; set; }
|
||||
public Nullable<int> SnType { get; set; }
|
||||
public string EditPwd { get; set; }
|
||||
public string ReleasePwd { get; set; }
|
||||
public string PacketMd5 { get; set; }
|
||||
}
|
||||
}
|
||||
23
AUTS.Domain/Entities/TBL_SyncList.cs
Normal file
23
AUTS.Domain/Entities/TBL_SyncList.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_SyncList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<System.DateTime> CurrentDate { get; set; }
|
||||
public string TableName { get; set; }
|
||||
public int RevisionID { get; set; }
|
||||
public string SyncType { get; set; }
|
||||
}
|
||||
}
|
||||
27
AUTS.Domain/Entities/TBL_UTS_Manage_AppList.cs
Normal file
27
AUTS.Domain/Entities/TBL_UTS_Manage_AppList.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_AppList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> ServiceID { get; set; }
|
||||
public Nullable<int> AppID { get; set; }
|
||||
public string AppName { get; set; }
|
||||
public string AppVersion { get; set; }
|
||||
public Nullable<System.DateTime> RegisterDateTime { get; set; }
|
||||
public Nullable<System.DateTime> LastActiveDateTime { get; set; }
|
||||
public string LastInfomation { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
28
AUTS.Domain/Entities/TBL_UTS_Manage_AppLog.cs
Normal file
28
AUTS.Domain/Entities/TBL_UTS_Manage_AppLog.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_AppLog
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> ServiceID { get; set; }
|
||||
public string AppName { get; set; }
|
||||
public string AppVersion { get; set; }
|
||||
public string ProjectName { get; set; }
|
||||
public string StationName { get; set; }
|
||||
public string TestPlan { get; set; }
|
||||
public Nullable<System.DateTime> DateTime { get; set; }
|
||||
public string LogType { get; set; }
|
||||
public string LogText { get; set; }
|
||||
}
|
||||
}
|
||||
23
AUTS.Domain/Entities/TBL_UTS_Manage_AuthLog.cs
Normal file
23
AUTS.Domain/Entities/TBL_UTS_Manage_AuthLog.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_AuthLog
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> UserID { get; set; }
|
||||
public Nullable<int> AuthID { get; set; }
|
||||
public Nullable<int> Auth { get; set; }
|
||||
public bool Exist { get; set; }
|
||||
}
|
||||
}
|
||||
21
AUTS.Domain/Entities/TBL_UTS_Manage_AuthManage.cs
Normal file
21
AUTS.Domain/Entities/TBL_UTS_Manage_AuthManage.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_AuthManage
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string ModuleID { get; set; }
|
||||
public string Describe { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_UTS_Manage_Company.cs
Normal file
22
AUTS.Domain/Entities/TBL_UTS_Manage_Company.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_Company
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public System.DateTime CreateTime { get; set; }
|
||||
public System.DateTime UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
25
AUTS.Domain/Entities/TBL_UTS_Manage_DBList.cs
Normal file
25
AUTS.Domain/Entities/TBL_UTS_Manage_DBList.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_DBList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> CompanyID { get; set; }
|
||||
public string DatabaseName { get; set; }
|
||||
public string DatabaseUser { get; set; }
|
||||
public string DatabasePassword { get; set; }
|
||||
public string DatabaseDesc { get; set; }
|
||||
public System.DateTime UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
44
AUTS.Domain/Entities/TBL_UTS_Manage_DataServiceList.cs
Normal file
44
AUTS.Domain/Entities/TBL_UTS_Manage_DataServiceList.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_DataServiceList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> LicenseID { get; set; }
|
||||
public string LicenseValidDateTime { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
public string TerminalOS { get; set; }
|
||||
public string TerminalType { get; set; }
|
||||
public string TerminalName { get; set; }
|
||||
public string TerminalAlias { get; set; }
|
||||
public string TerminalMAC { get; set; }
|
||||
public string ServiceVersion { get; set; }
|
||||
public Nullable<System.DateTime> ServiceRegisterDateTime { get; set; }
|
||||
public Nullable<System.DateTime> ServiceLastActiveDateTime { get; set; }
|
||||
public Nullable<sbyte> ServiceValid { get; set; }
|
||||
public bool IsOnline { get; set; }
|
||||
public Nullable<System.DateTime> ServiceOnlineDateTime { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
public string ErrMsg { get; set; }
|
||||
public string USVer { get; set; }
|
||||
public Nullable<bool> USIsOnline { get; set; }
|
||||
public string USErrMsg { get; set; }
|
||||
public Nullable<int> ManageStatus { get; set; }
|
||||
public string NetworkNeiborhood { get; set; }
|
||||
public Nullable<int> CacheCount { get; set; }
|
||||
public Nullable<int> IsDBProxyConn { get; set; }
|
||||
public Nullable<int> Roles { get; set; }
|
||||
public string BarnchNet { get; set; }
|
||||
}
|
||||
}
|
||||
28
AUTS.Domain/Entities/TBL_UTS_Manage_DataServiceLog.cs
Normal file
28
AUTS.Domain/Entities/TBL_UTS_Manage_DataServiceLog.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_DataServiceLog
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> ServiceID { get; set; }
|
||||
public string ServiceVersion { get; set; }
|
||||
public string UpdateServiceVersion { get; set; }
|
||||
public string VendorName { get; set; }
|
||||
public Nullable<System.DateTime> DateTime { get; set; }
|
||||
public string PublicIp { get; set; }
|
||||
public string PrivateIp { get; set; }
|
||||
public string LogType { get; set; }
|
||||
public string LogText { get; set; }
|
||||
}
|
||||
}
|
||||
29
AUTS.Domain/Entities/TBL_UTS_Manage_DevLog.cs
Normal file
29
AUTS.Domain/Entities/TBL_UTS_Manage_DevLog.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_DevLog
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public Nullable<int> DevID { get; set; }
|
||||
public Nullable<System.DateTime> DateTime { get; set; }
|
||||
public string Public_IP { get; set; }
|
||||
public string Private_IP { get; set; }
|
||||
public string LicFileName { get; set; }
|
||||
public string AppName { get; set; }
|
||||
public string AppVersion { get; set; }
|
||||
public string TestPlan { get; set; }
|
||||
public Nullable<int> UserID { get; set; }
|
||||
public string Operation { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_UTS_Manage_ErrCode.cs
Normal file
22
AUTS.Domain/Entities/TBL_UTS_Manage_ErrCode.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_ErrCode
|
||||
{
|
||||
public string ErrCode { get; set; }
|
||||
public string ErrMsg { get; set; }
|
||||
public string ErrColor { get; set; }
|
||||
public System.DateTime UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
24
AUTS.Domain/Entities/TBL_UTS_Manage_LicenseList.cs
Normal file
24
AUTS.Domain/Entities/TBL_UTS_Manage_LicenseList.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_LicenseList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
public Nullable<System.DateTime> ReleaseDate { get; set; }
|
||||
public Nullable<System.DateTime> ValidDateTime { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_UTS_Manage_Log.cs
Normal file
22
AUTS.Domain/Entities/TBL_UTS_Manage_Log.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_Log
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public System.DateTime DateTime { get; set; }
|
||||
public string Operation { get; set; }
|
||||
}
|
||||
}
|
||||
24
AUTS.Domain/Entities/TBL_UTS_Manage_Module.cs
Normal file
24
AUTS.Domain/Entities/TBL_UTS_Manage_Module.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_Module
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string Operation { get; set; }
|
||||
public string Controller { get; set; }
|
||||
public string Method { get; set; }
|
||||
public Nullable<bool> Exist { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_UTS_Manage_OrderStatus.cs
Normal file
22
AUTS.Domain/Entities/TBL_UTS_Manage_OrderStatus.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_OrderStatus
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string StatusName { get; set; }
|
||||
public string Remark { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
21
AUTS.Domain/Entities/TBL_UTS_Manage_SearchKey.cs
Normal file
21
AUTS.Domain/Entities/TBL_UTS_Manage_SearchKey.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_SearchKey
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int DataBaseID { get; set; }
|
||||
public string SearchVarKey { get; set; }
|
||||
}
|
||||
}
|
||||
32
AUTS.Domain/Entities/TBL_UTS_Manage_ServiceLog.cs
Normal file
32
AUTS.Domain/Entities/TBL_UTS_Manage_ServiceLog.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_ServiceLog
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string AppName { get; set; }
|
||||
public Nullable<System.DateTime> DateTime { get; set; }
|
||||
public string DevPublicIP { get; set; }
|
||||
public string DevPrivateIP { get; set; }
|
||||
public string DevMac { get; set; }
|
||||
public string DevOS { get; set; }
|
||||
public string DevName { get; set; }
|
||||
public string DevUserName { get; set; }
|
||||
public string DevOnline { get; set; }
|
||||
public string LogType { get; set; }
|
||||
public string LogText { get; set; }
|
||||
public string CompanyName { get; set; }
|
||||
public string AppVersion { get; set; }
|
||||
}
|
||||
}
|
||||
24
AUTS.Domain/Entities/TBL_UTS_Manage_SwReleaseLog.cs
Normal file
24
AUTS.Domain/Entities/TBL_UTS_Manage_SwReleaseLog.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_SwReleaseLog
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string SoftwareName { get; set; }
|
||||
public System.DateTime ReleaseDate { get; set; }
|
||||
public string ReleaseVersion { get; set; }
|
||||
public Nullable<int> UserID { get; set; }
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
26
AUTS.Domain/Entities/TBL_UTS_Manage_SwUpdate.cs
Normal file
26
AUTS.Domain/Entities/TBL_UTS_Manage_SwUpdate.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_SwUpdate
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string SoftwareName { get; set; }
|
||||
public string LastVersion { get; set; }
|
||||
public Nullable<System.DateTime> ReleaseDate { get; set; }
|
||||
public byte[] BinPackage { get; set; }
|
||||
public string BinPackageMd5 { get; set; }
|
||||
public string PackageName { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
22
AUTS.Domain/Entities/TBL_UTS_Manage_SyncList.cs
Normal file
22
AUTS.Domain/Entities/TBL_UTS_Manage_SyncList.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_SyncList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string TableName { get; set; }
|
||||
public int RevisionID { get; set; }
|
||||
public string SyncType { get; set; }
|
||||
}
|
||||
}
|
||||
24
AUTS.Domain/Entities/TBL_UTS_Manage_TestPlanTips.cs
Normal file
24
AUTS.Domain/Entities/TBL_UTS_Manage_TestPlanTips.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_TestPlanTips
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string ColName { get; set; }
|
||||
public string ColType { get; set; }
|
||||
public string ColDesc { get; set; }
|
||||
public string ColValue { get; set; }
|
||||
public System.DateTime UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
33
AUTS.Domain/Entities/TBL_UTS_Manage_User.cs
Normal file
33
AUTS.Domain/Entities/TBL_UTS_Manage_User.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_User
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int CompanyID { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
public Nullable<System.DateTime> CreateTime { get; set; }
|
||||
public string Mobile { get; set; }
|
||||
public string WeiXin { get; set; }
|
||||
public string Email { get; set; }
|
||||
public bool IsValid { get; set; }
|
||||
public bool IsAdmin { get; set; }
|
||||
public string BarCode { get; set; }
|
||||
public bool SetBarCode { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
public bool AccountBill { get; set; }
|
||||
public string PlaintextPwd { get; set; }
|
||||
}
|
||||
}
|
||||
25
AUTS.Domain/Entities/TBL_UTS_Manage_UserAuth_Operation.cs
Normal file
25
AUTS.Domain/Entities/TBL_UTS_Manage_UserAuth_Operation.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_UserAuth_Operation
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int UserID { get; set; }
|
||||
public int DatabaseID { get; set; }
|
||||
public string DatabaseName { get; set; }
|
||||
public string FullAccess { get; set; }
|
||||
public string ReadWriteAccess { get; set; }
|
||||
public string ReadOnlyAccess { get; set; }
|
||||
}
|
||||
}
|
||||
64
AUTS.Domain/Entities/TBL_UTS_Manage_UtsCmdList.cs
Normal file
64
AUTS.Domain/Entities/TBL_UTS_Manage_UtsCmdList.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码已从模板生成。
|
||||
//
|
||||
// 手动更改此文件可能导致应用程序出现意外的行为。
|
||||
// 如果重新生成代码,将覆盖对此文件的手动更改。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace AUTS.Domain.Entities
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class TBL_UTS_Manage_UtsCmdList
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public string CmdType { get; set; }
|
||||
public string CmdName { get; set; }
|
||||
public string CmdDesc { get; set; }
|
||||
public string ParamCount { get; set; }
|
||||
public string ParamDesc1 { get; set; }
|
||||
public string ParamDesc2 { get; set; }
|
||||
public string ParamDesc3 { get; set; }
|
||||
public string ParamDesc4 { get; set; }
|
||||
public string ParamDesc5 { get; set; }
|
||||
public string ParamDesc6 { get; set; }
|
||||
public string ParamDesc7 { get; set; }
|
||||
public string ParamDesc8 { get; set; }
|
||||
public string ParamType1 { get; set; }
|
||||
public string ParamType2 { get; set; }
|
||||
public string ParamType3 { get; set; }
|
||||
public string ParamType4 { get; set; }
|
||||
public string ParamType5 { get; set; }
|
||||
public string ParamType6 { get; set; }
|
||||
public string ParamType7 { get; set; }
|
||||
public string ParamType8 { get; set; }
|
||||
public string ParamLower1 { get; set; }
|
||||
public string ParamLower2 { get; set; }
|
||||
public string ParamLower3 { get; set; }
|
||||
public string ParamLower4 { get; set; }
|
||||
public string ParamLower5 { get; set; }
|
||||
public string ParamLower6 { get; set; }
|
||||
public string ParamLower7 { get; set; }
|
||||
public string ParamLower8 { get; set; }
|
||||
public string ParamUpper1 { get; set; }
|
||||
public string ParamUpper2 { get; set; }
|
||||
public string ParamUpper3 { get; set; }
|
||||
public string ParamUpper4 { get; set; }
|
||||
public string ParamUpper5 { get; set; }
|
||||
public string ParamUpper6 { get; set; }
|
||||
public string ParamUpper7 { get; set; }
|
||||
public string ParamUpper8 { get; set; }
|
||||
public string ParamValue1 { get; set; }
|
||||
public string ParamValue2 { get; set; }
|
||||
public string ParamValue3 { get; set; }
|
||||
public string ParamValue4 { get; set; }
|
||||
public string ParamValue5 { get; set; }
|
||||
public string ParamValue6 { get; set; }
|
||||
public string ParamValue7 { get; set; }
|
||||
public string ParamValue8 { get; set; }
|
||||
public Nullable<System.DateTime> UpdateTime { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user