Пример #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);
        }
Пример #2
0
        public void CreateView(Domain.Entity entity)
        {
            var defaultAttributes = _defaultAttributeProvider.GetSysAttributes(entity);

            _metadataProvider.AlterView(entity, defaultAttributes, _defaultAttributeProvider.GetSysAttributeRelationShips(entity, defaultAttributes));
        }