Beispiel #1
0
        static void Main(string[] args)
        {
            List <EntityClass> list      = new List <EntityClass>();
            TypeFuncs          typeFuncs = new TypeFuncs();

            typeFuncs.Dicdefinition();
            for (int i = 0; i < 50; i++)
            {
                EntityClass    entityClass = new EntityClass();
                Type           type        = entityClass.GetType();
                PropertyInfo[] pis         = type.GetProperties();
                foreach (PropertyInfo p in pis)
                {
                    string typeName = p.PropertyType.Name;
                    typeFuncs.Dic[typeName](p, entityClass, i);
                }
                list.Add(entityClass);
            }
        }
Beispiel #2
0
 public void WriteDatatimeValue(PropertyInfo p, EntityClass entityClass, int i)
 {
     p.SetValue(entityClass, Convert.ToDateTime(i));
 }
Beispiel #3
0
 public void WriteStringValue(PropertyInfo p, EntityClass entityClass, int i)
 {
     p.SetValue(entityClass, Convert.ToString(i));
 }
Beispiel #4
0
 public void WriteIntValue(PropertyInfo p, EntityClass entityClass, int i)
 {
     p.SetValue(entityClass, i);
 }
Beispiel #5
0
 public void WriteFloatValue(PropertyInfo p, EntityClass entityClass, int i)
 {
     p.SetValue(entityClass, Convert.ToSingle(i));
 }
Beispiel #6
0
 public void WriteDoubleValue(PropertyInfo p, EntityClass entityClass, int i)
 {
     p.SetValue(entityClass, Convert.ToDouble(i));
 }
Beispiel #7
0
 public void WriteDecimalValue(PropertyInfo p, EntityClass entityClass, int i)
 {
     p.SetValue(entityClass, Convert.ToDecimal(i));
 }