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