Esempio n. 1
0
        /// <summary>
        /// 创建记录
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public bool Create(Domain.Entity entity, List <Domain.Attribute> defaultAttributes, List <Domain.RelationShip> defaultRelationShips)
        {
            var flag = false;

            using (UnitOfWork.Build(DbContext))
            {
                flag = base.Create(entity);
                //创建数据库表
                _metadataProvider.CreateTable(entity, defaultAttributes);
                //创建SQL视图
                _metadataProvider.AlterView(entity, defaultAttributes, defaultRelationShips);
            }
            return(flag);
        }
Esempio n. 2
0
 public void CreateTable(Domain.Entity entity, List <Domain.Attribute> defaultAttributes)
 {
     _metadataProvider.CreateTable(entity, defaultAttributes);
 }