migratino complete

This commit is contained in:
chi
2025-04-07 00:54:29 +09:00
parent 2b22ca9c51
commit 8ac3600ec1
158 changed files with 39098 additions and 21257 deletions

View File

@@ -1,35 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 템플릿에서 생성되었습니다.
//
// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FBS0000
{
using System;
using System.Collections.Generic;
public partial class EETGW_HolydayRequest
{
public int idx { get; set; }
public string gcode { get; set; }
public string uid { get; set; }
public string cate { get; set; }
public string sdate { get; set; }
public string edate { get; set; }
public Nullable<int> conf { get; set; }
public string Remark { get; set; }
public string Response { get; set; }
public string HolyReason { get; set; }
public string HolyBackup { get; set; }
public string HolyLocation { get; set; }
public Nullable<int> HolyDays { get; set; }
public Nullable<double> HolyTimes { get; set; }
public Nullable<bool> sendmail { get; set; }
public string wuid { get; set; }
public System.DateTime wdate { get; set; }
}
}

View File

@@ -136,9 +136,6 @@
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="EETGW_HolydayRequest.cs">
<DependentUpon>Model_BS0000.tt</DependentUpon>
</Compile>
<Compile Include="fLovWorkUser.cs">
<SubType>Form</SubType>
</Compile>
@@ -223,27 +220,6 @@
<Compile Include="Holiday\fHolyday_Add.Designer.cs">
<DependentUpon>fHolyday_Add.cs</DependentUpon>
</Compile>
<Compile Include="Holyday.cs">
<DependentUpon>Model_BS0000.tt</DependentUpon>
</Compile>
<Compile Include="JobReport.cs">
<DependentUpon>Model_BS0000.tt</DependentUpon>
</Compile>
<Compile Include="Model_BS0000.Context.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Model_BS0000.Context.tt</DependentUpon>
</Compile>
<Compile Include="Model_BS0000.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Model_BS0000.tt</DependentUpon>
</Compile>
<Compile Include="Model_BS0000.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Model_BS0000.edmx</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Holiday\rHolidaySummary.cs">
@@ -252,9 +228,6 @@
<Compile Include="Holiday\rHolidaySummary.Designer.cs">
<DependentUpon>rHolidaySummary.cs</DependentUpon>
</Compile>
<Compile Include="Users.cs">
<DependentUpon>Model_BS0000.tt</DependentUpon>
</Compile>
<EmbeddedResource Include="fLovWorkUser.resx">
<DependentUpon>fLovWorkUser.cs</DependentUpon>
</EmbeddedResource>
@@ -336,13 +309,6 @@
<None Include="dsReport.xss">
<DependentUpon>dsReport.xsd</DependentUpon>
</None>
<EntityDeploy Include="Model_BS0000.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>Model_BS0000.Designer.cs</LastGenOutput>
</EntityDeploy>
<None Include="Model_BS0000.edmx.diagram">
<DependentUpon>Model_BS0000.edmx</DependentUpon>
</None>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
@@ -368,16 +334,6 @@
<None Include="Resources\action_refresh.gif" />
</ItemGroup>
<ItemGroup>
<Content Include="Model_BS0000.Context.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>Model_BS0000.edmx</DependentUpon>
<LastGenOutput>Model_BS0000.Context.cs</LastGenOutput>
</Content>
<Content Include="Model_BS0000.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<DependentUpon>Model_BS0000.edmx</DependentUpon>
<LastGenOutput>Model_BS0000.cs</LastGenOutput>
</Content>
<Content Include="SqlServerTypes\readme.htm" />
<Content Include="SqlServerTypes\x64\msvcr120.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

View File

@@ -1,41 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 템플릿에서 생성되었습니다.
//
// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FBS0000
{
using System;
using System.Collections.Generic;
public partial class Holyday
{
public int idx { get; set; }
public string gcode { get; set; }
public string cate { get; set; }
public string result { get; set; }
public Nullable<System.DateTime> sdate { get; set; }
public Nullable<System.DateTime> edate { get; set; }
public Nullable<double> term { get; set; }
public Nullable<double> termDr { get; set; }
public Nullable<double> DrTime { get; set; }
public Nullable<double> CrTime { get; set; }
public string title { get; set; }
public string contents { get; set; }
public string uid { get; set; }
public string tolist { get; set; }
public Nullable<bool> mail { get; set; }
public Nullable<bool> mailsend { get; set; }
public string tag { get; set; }
public string reason { get; set; }
public string wuid { get; set; }
public System.DateTime wdate { get; set; }
public string extcate { get; set; }
public Nullable<int> extidx { get; set; }
public Nullable<bool> @lock { get; set; }
}
}

View File

@@ -1,46 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 템플릿에서 생성되었습니다.
//
// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FBS0000
{
using System;
using System.Collections.Generic;
public partial class JobReport
{
public int idx { get; set; }
public string gcode { get; set; }
public string pdate { get; set; }
public Nullable<int> pidx { get; set; }
public string projectName { get; set; }
public string uid { get; set; }
public string requestpart { get; set; }
public string package { get; set; }
public string status { get; set; }
public string type { get; set; }
public string process { get; set; }
public string description { get; set; }
public string remark { get; set; }
public Nullable<double> hrs { get; set; }
public Nullable<double> ot { get; set; }
public Nullable<System.DateTime> otStart { get; set; }
public Nullable<System.DateTime> otEnd { get; set; }
public Nullable<bool> import { get; set; }
public string wuid { get; set; }
public System.DateTime wdate { get; set; }
public string description2 { get; set; }
public string tag { get; set; }
public Nullable<bool> autoinput { get; set; }
public string kisullv { get; set; }
public string kisuldiv { get; set; }
public Nullable<decimal> kisulamt { get; set; }
public Nullable<double> ot2 { get; set; }
public string otReason { get; set; }
}
}

View File

@@ -1,33 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 템플릿에서 생성되었습니다.
//
// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FBS0000
{
using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public partial class EEEntities_BS0000 : DbContext
{
public EEEntities_BS0000()
: base("name=EEEntities_BS0000")
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}
public virtual DbSet<EETGW_HolydayRequest> EETGW_HolydayRequest { get; set; }
public virtual DbSet<Holyday> Holyday { get; set; }
public virtual DbSet<JobReport> JobReport { get; set; }
public virtual DbSet<Users> Users { get; set; }
}
}

View File

@@ -1,636 +0,0 @@
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
output extension=".cs"#><#
const string inputFile = @"Model_BS0000.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);
}
}
#>

View File

@@ -1,10 +0,0 @@
// 모델 'D:\Source\##### 완료아이템\(0014) GroupWare\Source\SubProject\FBS0000\Model_BS0000.edmx'에 대해 T4 코드 생성이 사용됩니다.
// 레거시 코드 생성을 사용하려면 '코드 생성 전략' 디자이너 속성의 값을
// 'Legacy ObjectContext'로 변경하십시오. 이 속성은 모델이 디자이너에서 열릴 때
// 속성 창에서 사용할 수 있습니다.
// 컨텍스트 및 엔터티 클래스가 생성되지 않은 경우 빈 모델을 만들었기 때문일 수도 있지만
// 사용할 Entity Framework 버전을 선택하지 않았기 때문일 수도 있습니다. 모델에 맞는 컨텍스트 클래스 및
// 엔터티 클래스를 생성하려면 디자이너에서 모델을 열고 디자이너 화면에서 마우스 오른쪽 단추를 클릭한
// 다음 '데이터베이스에서 모델 업데이트...', '모델에서 데이터베이스 생성...' 또는 '코드 생성 항목 추가...'를
// 선택하십시오.

View File

@@ -1,9 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 템플릿에서 생성되었습니다.
//
// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
// </auto-generated>
//------------------------------------------------------------------------------

View File

@@ -1,385 +0,0 @@
<?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="EEModel_BS0000.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2008" 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="EETGW_HolydayRequest">
<Key>
<PropertyRef Name="idx" />
</Key>
<Property Name="idx" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="gcode" Type="varchar" MaxLength="10" Nullable="false" />
<Property Name="uid" Type="varchar" MaxLength="20" />
<Property Name="cate" Type="varchar" MaxLength="20" />
<Property Name="sdate" Type="varchar" MaxLength="10" />
<Property Name="edate" Type="varchar" MaxLength="10" />
<Property Name="conf" Type="int" />
<Property Name="Remark" Type="varchar" MaxLength="255" />
<Property Name="Response" Type="varchar" MaxLength="255" />
<Property Name="HolyReason" Type="varchar" MaxLength="100" />
<Property Name="HolyBackup" Type="varchar" MaxLength="100" />
<Property Name="HolyLocation" Type="varchar" MaxLength="100" />
<Property Name="HolyDays" Type="int" />
<Property Name="HolyTimes" Type="float" />
<Property Name="sendmail" Type="bit" />
<Property Name="wuid" Type="varchar" MaxLength="20" Nullable="false" />
<Property Name="wdate" Type="smalldatetime" Nullable="false" />
</EntityType>
<EntityType Name="Holyday">
<Key>
<PropertyRef Name="idx" />
</Key>
<Property Name="idx" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="gcode" Type="varchar" MaxLength="10" Nullable="false" />
<Property Name="cate" Type="varchar" MaxLength="20" />
<Property Name="result" Type="varchar" MaxLength="20" />
<Property Name="sdate" Type="date" />
<Property Name="edate" Type="date" />
<Property Name="term" Type="float" />
<Property Name="termDr" Type="float" />
<Property Name="DrTime" Type="float" />
<Property Name="CrTime" Type="float" />
<Property Name="title" Type="nvarchar" MaxLength="255" />
<Property Name="contents" Type="nvarchar(max)" />
<Property Name="uid" Type="varchar" MaxLength="20" />
<Property Name="tolist" Type="varchar(max)" />
<Property Name="mail" Type="bit" />
<Property Name="mailsend" Type="bit" />
<Property Name="tag" Type="varchar" MaxLength="50" />
<Property Name="reason" Type="varchar(max)" />
<Property Name="wuid" Type="varchar" MaxLength="20" Nullable="false" />
<Property Name="wdate" Type="smalldatetime" Nullable="false" />
<Property Name="extcate" Type="varchar" MaxLength="10" />
<Property Name="extidx" Type="int" />
<Property Name="lock" Type="bit" />
</EntityType>
<EntityType Name="JobReport">
<Key>
<PropertyRef Name="idx" />
</Key>
<Property Name="idx" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="gcode" Type="varchar" MaxLength="10" Nullable="false" />
<Property Name="pdate" Type="varchar" MaxLength="10" />
<Property Name="pidx" Type="int" />
<Property Name="projectName" Type="nvarchar" MaxLength="255" />
<Property Name="uid" Type="varchar" MaxLength="20" />
<Property Name="requestpart" Type="varchar" MaxLength="50" />
<Property Name="package" Type="varchar" MaxLength="50" />
<Property Name="status" Type="varchar" MaxLength="20" />
<Property Name="type" Type="varchar" MaxLength="50" />
<Property Name="process" Type="varchar" MaxLength="50" />
<Property Name="description" Type="nvarchar(max)" />
<Property Name="remark" Type="nvarchar" MaxLength="255" />
<Property Name="hrs" Type="float" />
<Property Name="ot" Type="float" />
<Property Name="otStart" Type="datetime" />
<Property Name="otEnd" Type="datetime" />
<Property Name="import" Type="bit" />
<Property Name="wuid" Type="varchar" MaxLength="20" Nullable="false" />
<Property Name="wdate" Type="smalldatetime" Nullable="false" />
<Property Name="description2" Type="nvarchar(max)" />
<Property Name="tag" Type="varchar" MaxLength="255" />
<Property Name="autoinput" Type="bit" />
<Property Name="kisullv" Type="varchar" MaxLength="10" />
<Property Name="kisuldiv" Type="varchar" MaxLength="100" />
<Property Name="kisulamt" Type="decimal" Precision="18" Scale="3" />
<Property Name="ot2" Type="float" />
<Property Name="otReason" Type="varchar" MaxLength="255" />
</EntityType>
<EntityType Name="Users">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="varchar" MaxLength="20" Nullable="false" />
<Property Name="gcode" Type="varchar" MaxLength="10" />
<Property Name="password" Type="varchar" MaxLength="50" />
<Property Name="nameE" Type="nvarchar" MaxLength="100" />
<Property Name="name" Type="nvarchar" MaxLength="100" />
<Property Name="dept" Type="varchar" MaxLength="100" />
<Property Name="grade" Type="varchar" MaxLength="10" />
<Property Name="email" Type="varchar" MaxLength="100" />
<Property Name="level" Type="smallint" />
<Property Name="indate" Type="varchar" MaxLength="20" />
<Property Name="outdate" Type="varchar" MaxLength="20" />
<Property Name="tel" Type="varchar" MaxLength="20" />
<Property Name="hp" Type="varchar" MaxLength="20" />
<Property Name="place" Type="varchar" MaxLength="100" />
<Property Name="ads_employNo" Type="varchar" MaxLength="50" />
<Property Name="ads_title" Type="nvarchar" MaxLength="100" />
<Property Name="ads_created" Type="varchar" MaxLength="50" />
<Property Name="memo" Type="nvarchar" MaxLength="255" />
<Property Name="wuid" Type="varchar" MaxLength="20" Nullable="false" />
<Property Name="wdate" Type="smalldatetime" Nullable="false" />
<Property Name="processs" Type="nvarchar" MaxLength="100" />
</EntityType>
<EntityContainer Name="EEModel_BS0000StoreContainer">
<EntitySet Name="EETGW_HolydayRequest" EntityType="Self.EETGW_HolydayRequest" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Holyday" EntityType="Self.Holyday" Schema="dbo" store:Type="Tables" />
<EntitySet Name="JobReport" EntityType="Self.JobReport" Schema="dbo" store:Type="Tables" />
<EntitySet Name="Users" EntityType="Self.Users" Schema="dbo" store:Type="Tables" />
</EntityContainer>
</Schema>
</edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="EEModel_BS0000" 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">
<EntityType Name="EETGW_HolydayRequest">
<Key>
<PropertyRef Name="idx" />
</Key>
<Property Name="idx" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="gcode" Type="String" MaxLength="10" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="uid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="cate" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="sdate" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="edate" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="conf" Type="Int32" />
<Property Name="Remark" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="Response" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="HolyReason" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="HolyBackup" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="HolyLocation" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="HolyDays" Type="Int32" />
<Property Name="HolyTimes" Type="Double" />
<Property Name="sendmail" Type="Boolean" />
<Property Name="wuid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="wdate" Type="DateTime" Nullable="false" Precision="0" />
</EntityType>
<EntityType Name="Holyday">
<Key>
<PropertyRef Name="idx" />
</Key>
<Property Name="idx" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="gcode" Type="String" MaxLength="10" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="cate" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="result" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="sdate" Type="DateTime" Precision="0" />
<Property Name="edate" Type="DateTime" Precision="0" />
<Property Name="term" Type="Double" />
<Property Name="termDr" Type="Double" />
<Property Name="DrTime" Type="Double" />
<Property Name="CrTime" Type="Double" />
<Property Name="title" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Name="contents" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="uid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="tolist" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
<Property Name="mail" Type="Boolean" />
<Property Name="mailsend" Type="Boolean" />
<Property Name="tag" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="reason" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
<Property Name="wuid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="wdate" Type="DateTime" Nullable="false" Precision="0" />
<Property Name="extcate" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="extidx" Type="Int32" />
<Property Name="lock" Type="Boolean" />
</EntityType>
<EntityType Name="JobReport">
<Key>
<PropertyRef Name="idx" />
</Key>
<Property Name="idx" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="gcode" Type="String" MaxLength="10" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="pdate" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="pidx" Type="Int32" />
<Property Name="projectName" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Name="uid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="requestpart" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="package" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="status" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="type" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="process" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="description" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="remark" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Name="hrs" Type="Double" />
<Property Name="ot" Type="Double" />
<Property Name="otStart" Type="DateTime" Precision="3" />
<Property Name="otEnd" Type="DateTime" Precision="3" />
<Property Name="import" Type="Boolean" />
<Property Name="wuid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="wdate" Type="DateTime" Nullable="false" Precision="0" />
<Property Name="description2" Type="String" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Name="tag" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
<Property Name="autoinput" Type="Boolean" />
<Property Name="kisullv" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="kisuldiv" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="kisulamt" Type="Decimal" Precision="18" Scale="3" />
<Property Name="ot2" Type="Double" />
<Property Name="otReason" Type="String" MaxLength="255" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="Users">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="gcode" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="password" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="nameE" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
<Property Name="name" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
<Property Name="dept" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="grade" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="email" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="level" Type="Int16" />
<Property Name="indate" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="outdate" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="tel" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="hp" Type="String" MaxLength="20" FixedLength="false" Unicode="false" />
<Property Name="place" Type="String" MaxLength="100" FixedLength="false" Unicode="false" />
<Property Name="ads_employNo" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="ads_title" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
<Property Name="ads_created" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
<Property Name="memo" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Name="wuid" Type="String" MaxLength="20" FixedLength="false" Unicode="false" Nullable="false" />
<Property Name="wdate" Type="DateTime" Nullable="false" Precision="0" />
<Property Name="processs" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
</EntityType>
<EntityContainer Name="EEEntities_BS0000" annotation:LazyLoadingEnabled="true">
<EntitySet Name="EETGW_HolydayRequest" EntityType="Self.EETGW_HolydayRequest" />
<EntitySet Name="Holyday" EntityType="Self.Holyday" />
<EntitySet Name="JobReport" EntityType="Self.JobReport" />
<EntitySet Name="Users" EntityType="Self.Users" />
</EntityContainer>
</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="EEModel_BS0000StoreContainer" CdmEntityContainer="EEEntities_BS0000">
<EntitySetMapping Name="EETGW_HolydayRequest">
<EntityTypeMapping TypeName="EEModel_BS0000.EETGW_HolydayRequest">
<MappingFragment StoreEntitySet="EETGW_HolydayRequest">
<ScalarProperty Name="idx" ColumnName="idx" />
<ScalarProperty Name="gcode" ColumnName="gcode" />
<ScalarProperty Name="uid" ColumnName="uid" />
<ScalarProperty Name="cate" ColumnName="cate" />
<ScalarProperty Name="sdate" ColumnName="sdate" />
<ScalarProperty Name="edate" ColumnName="edate" />
<ScalarProperty Name="conf" ColumnName="conf" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="Response" ColumnName="Response" />
<ScalarProperty Name="HolyReason" ColumnName="HolyReason" />
<ScalarProperty Name="HolyBackup" ColumnName="HolyBackup" />
<ScalarProperty Name="HolyLocation" ColumnName="HolyLocation" />
<ScalarProperty Name="HolyDays" ColumnName="HolyDays" />
<ScalarProperty Name="HolyTimes" ColumnName="HolyTimes" />
<ScalarProperty Name="sendmail" ColumnName="sendmail" />
<ScalarProperty Name="wuid" ColumnName="wuid" />
<ScalarProperty Name="wdate" ColumnName="wdate" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Holyday">
<EntityTypeMapping TypeName="EEModel_BS0000.Holyday">
<MappingFragment StoreEntitySet="Holyday">
<ScalarProperty Name="idx" ColumnName="idx" />
<ScalarProperty Name="gcode" ColumnName="gcode" />
<ScalarProperty Name="cate" ColumnName="cate" />
<ScalarProperty Name="result" ColumnName="result" />
<ScalarProperty Name="sdate" ColumnName="sdate" />
<ScalarProperty Name="edate" ColumnName="edate" />
<ScalarProperty Name="term" ColumnName="term" />
<ScalarProperty Name="termDr" ColumnName="termDr" />
<ScalarProperty Name="DrTime" ColumnName="DrTime" />
<ScalarProperty Name="CrTime" ColumnName="CrTime" />
<ScalarProperty Name="title" ColumnName="title" />
<ScalarProperty Name="contents" ColumnName="contents" />
<ScalarProperty Name="uid" ColumnName="uid" />
<ScalarProperty Name="tolist" ColumnName="tolist" />
<ScalarProperty Name="mail" ColumnName="mail" />
<ScalarProperty Name="mailsend" ColumnName="mailsend" />
<ScalarProperty Name="tag" ColumnName="tag" />
<ScalarProperty Name="reason" ColumnName="reason" />
<ScalarProperty Name="wuid" ColumnName="wuid" />
<ScalarProperty Name="wdate" ColumnName="wdate" />
<ScalarProperty Name="extcate" ColumnName="extcate" />
<ScalarProperty Name="extidx" ColumnName="extidx" />
<ScalarProperty Name="lock" ColumnName="lock" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="JobReport">
<EntityTypeMapping TypeName="EEModel_BS0000.JobReport">
<MappingFragment StoreEntitySet="JobReport">
<ScalarProperty Name="idx" ColumnName="idx" />
<ScalarProperty Name="gcode" ColumnName="gcode" />
<ScalarProperty Name="pdate" ColumnName="pdate" />
<ScalarProperty Name="pidx" ColumnName="pidx" />
<ScalarProperty Name="projectName" ColumnName="projectName" />
<ScalarProperty Name="uid" ColumnName="uid" />
<ScalarProperty Name="requestpart" ColumnName="requestpart" />
<ScalarProperty Name="package" ColumnName="package" />
<ScalarProperty Name="status" ColumnName="status" />
<ScalarProperty Name="type" ColumnName="type" />
<ScalarProperty Name="process" ColumnName="process" />
<ScalarProperty Name="description" ColumnName="description" />
<ScalarProperty Name="remark" ColumnName="remark" />
<ScalarProperty Name="hrs" ColumnName="hrs" />
<ScalarProperty Name="ot" ColumnName="ot" />
<ScalarProperty Name="otStart" ColumnName="otStart" />
<ScalarProperty Name="otEnd" ColumnName="otEnd" />
<ScalarProperty Name="import" ColumnName="import" />
<ScalarProperty Name="wuid" ColumnName="wuid" />
<ScalarProperty Name="wdate" ColumnName="wdate" />
<ScalarProperty Name="description2" ColumnName="description2" />
<ScalarProperty Name="tag" ColumnName="tag" />
<ScalarProperty Name="autoinput" ColumnName="autoinput" />
<ScalarProperty Name="kisullv" ColumnName="kisullv" />
<ScalarProperty Name="kisuldiv" ColumnName="kisuldiv" />
<ScalarProperty Name="kisulamt" ColumnName="kisulamt" />
<ScalarProperty Name="ot2" ColumnName="ot2" />
<ScalarProperty Name="otReason" ColumnName="otReason" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="Users">
<EntityTypeMapping TypeName="EEModel_BS0000.Users">
<MappingFragment StoreEntitySet="Users">
<ScalarProperty Name="id" ColumnName="id" />
<ScalarProperty Name="gcode" ColumnName="gcode" />
<ScalarProperty Name="password" ColumnName="password" />
<ScalarProperty Name="nameE" ColumnName="nameE" />
<ScalarProperty Name="name" ColumnName="name" />
<ScalarProperty Name="dept" ColumnName="dept" />
<ScalarProperty Name="grade" ColumnName="grade" />
<ScalarProperty Name="email" ColumnName="email" />
<ScalarProperty Name="level" ColumnName="level" />
<ScalarProperty Name="indate" ColumnName="indate" />
<ScalarProperty Name="outdate" ColumnName="outdate" />
<ScalarProperty Name="tel" ColumnName="tel" />
<ScalarProperty Name="hp" ColumnName="hp" />
<ScalarProperty Name="place" ColumnName="place" />
<ScalarProperty Name="ads_employNo" ColumnName="ads_employNo" />
<ScalarProperty Name="ads_title" ColumnName="ads_title" />
<ScalarProperty Name="ads_created" ColumnName="ads_created" />
<ScalarProperty Name="memo" ColumnName="memo" />
<ScalarProperty Name="wuid" ColumnName="wuid" />
<ScalarProperty Name="wdate" ColumnName="wdate" />
<ScalarProperty Name="processs" ColumnName="processs" />
</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>

View File

@@ -1,15 +0,0 @@
<?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="086ebb48a7cc43918745e360840d70cc" Name="Diagram1">
<EntityTypeShape EntityType="EEModel_BS0000.EETGW_HolydayRequest" Width="1.5" PointX="0.75" PointY="0.75" IsExpanded="true" />
<EntityTypeShape EntityType="EEModel_BS0000.Holyday" Width="1.5" PointX="2.75" PointY="0.75" IsExpanded="true" />
<EntityTypeShape EntityType="EEModel_BS0000.JobReport" Width="1.5" PointX="4.75" PointY="0.75" IsExpanded="true" />
<EntityTypeShape EntityType="EEModel_BS0000.Users" Width="1.5" PointX="6.75" PointY="0.75" IsExpanded="true" />
</Diagram>
</edmx:Diagrams>
</edmx:Designer>
</edmx:Edmx>

View File

@@ -1,733 +0,0 @@
<#@ template language="C#" debug="false" hostspecific="true"#>
<#@ include file="EF6.Utility.CS.ttinclude"#><#@
output extension=".cs"#><#
const string inputFile = @"Model_BS0000.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);
}
}
#>

View File

@@ -1,39 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 이 코드는 템플릿에서 생성되었습니다.
//
// 이 파일을 수동으로 변경하면 응용 프로그램에서 예기치 않은 동작이 발생할 수 있습니다.
// 이 파일을 수동으로 변경하면 코드가 다시 생성될 때 변경 내용을 덮어씁니다.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FBS0000
{
using System;
using System.Collections.Generic;
public partial class Users
{
public string id { get; set; }
public string gcode { get; set; }
public string password { get; set; }
public string nameE { get; set; }
public string name { get; set; }
public string dept { get; set; }
public string grade { get; set; }
public string email { get; set; }
public Nullable<short> level { get; set; }
public string indate { get; set; }
public string outdate { get; set; }
public string tel { get; set; }
public string hp { get; set; }
public string place { get; set; }
public string ads_employNo { get; set; }
public string ads_title { get; set; }
public string ads_created { get; set; }
public string memo { get; set; }
public string wuid { get; set; }
public System.DateTime wdate { get; set; }
public string processs { get; set; }
}
}