示例#1
0
        public void FieldPropertyInfos()
        {
            Modelinfo modelinfo = new Modelinfo(typeof(MdelinfoFoo));
            PropertyInfo[] fieldPropertyInfos = modelinfo.FieldPropertyInfos;
            Assert.AreEqual(1, fieldPropertyInfos.Length);

            modelinfo = new Modelinfo(typeof(ModelinfoBar));
            fieldPropertyInfos = modelinfo.FieldPropertyInfos;
            Assert.AreEqual(1, fieldPropertyInfos.Length);
        }
示例#2
0
 public static Modelinfo Get(Type type)
 {
     if(modelInfos.ContainsKey(type))
         modelInfos[type] = new Modelinfo(type);
         return modelInfos[type];
 }
示例#3
0
 public void TableName()
 {
     Modelinfo modelinfo = new Modelinfo(typeof(MdelinfoFoo));
     Assert.AreEqual("modelinfofoo",modelinfo.TableName);
 }
示例#4
0
 public void keyPropertyInfo()
 {
     Modelinfo modelinfo = new Modelinfo(typeof(MdelinfoFoo));
     Assert.IsNotNull(modelinfo.keyPropertyInfo);
     Assert.AreEqual("Id", modelinfo.keyPropertyInfo.Name);
 }
示例#5
0
 public void KeyName()
 {
     Modelinfo modelinfo = new Modelinfo(typeof(MdelinfoFoo));
     Assert.AreEqual("Id", modelinfo.KeyName);
 }