1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Reflection;
- using HNWD.Pregrant.Model;
-
- namespace HNWD.Pregrant.DataAccess
- {
- public static class FieldNickGenerator<Entity> where Entity : ModelBase,new()
- {
- public static StringBuilder GeneratFieldNick()
- {
- StringBuilder sb = new StringBuilder(" ");
- //Type t = typeof(Entity);
- //foreach (FieldInfo p in t.GetFields())
- //{
- // IgnoreAttribute[] attr = (IgnoreAttribute[])p.GetCustomAttributes(typeof(IgnoreAttribute), true);
- // if(!(attr == null || attr.Length == 0))
- // {
- // continue;
- // }
- // NickAttribute[] attrs = (NickAttribute[])p.GetCustomAttributes(typeof(NickAttribute), true);
- // if (attrs == null || attrs.Length == 0)
- // {
- // sb.Append(p.Name + " , ");
- // }
- // else
- // {
- // sb.Append(p.Name + " as " + attrs[0].NickName + ", ");
- // }
- //}
- sb.Append(" * ");
- return sb;
- }
- }
- }
|