초기 커밋.

This commit is contained in:
2025-02-03 11:02:48 +09:00
parent a7d46f415f
commit fe9aa0799f
2334 changed files with 674826 additions and 0 deletions

View 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;
}
}
}
}