초기 커밋.
This commit is contained in:
63
JWH/DATA/CustomerAttributes.cs
Normal file
63
JWH/DATA/CustomerAttributes.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace JWH.DATA
|
||||
{
|
||||
|
||||
public static class CustomerAttributes
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Primary Key Attribute
|
||||
/// </summary>
|
||||
public sealed class PrimaryKeyAttribute : Attribute
|
||||
{
|
||||
|
||||
public bool PrimaryKey { get; }
|
||||
|
||||
public PrimaryKeyAttribute(bool value)
|
||||
{
|
||||
this.PrimaryKey = value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Length Attribute
|
||||
/// </summary>
|
||||
public sealed class LengthAttribute : Attribute
|
||||
{
|
||||
|
||||
public int Length { get; }
|
||||
|
||||
public LengthAttribute(int length)
|
||||
{
|
||||
this.Length = length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PropertyInfo.LengthAttribute 속성값을 반환한다
|
||||
/// </summary>
|
||||
/// <param name="property"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetPropertyLength(this PropertyInfo property)
|
||||
{
|
||||
try
|
||||
{
|
||||
LengthAttribute attribute = (LengthAttribute)Attribute.GetCustomAttribute(property, typeof(LengthAttribute), true);
|
||||
if (attribute == null) return 0;
|
||||
|
||||
return attribute.Length;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
XLogger.Instance.Fatal(ex);
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
9
JWH/DATA/DataTableBase.cs
Normal file
9
JWH/DATA/DataTableBase.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace JWH.DATA
|
||||
{
|
||||
|
||||
public class DataTableBase
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user