示例#1
0
 public virtual void AddField(string className, System.Type fieldType, string fieldName
                              )
 {
     NeoDatis.Odb.Core.Layers.Layer2.Meta.MetaModel metaModel = storageEngine.GetSession
                                                                    (true).GetMetaModel();
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci = metaModel.GetClassInfo(className
                                                                                , true);
     // The real attribute id (-1) will be set in the ci.addAttribute
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassAttributeInfo cai = new NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassAttributeInfo
                                                                       (-1, fieldName, fieldType.FullName, ci);
     ci.AddAttribute(cai);
     storageEngine.GetObjectWriter().UpdateClassInfo(ci, true);
 }