예제 #1
0
        public override async Task UninstallAsync(IServiceProvider serviceProvider, Func <Task> unsinstallFunc)
        {
            XncfBuilderEntities mySenparcEntities = serviceProvider.GetService <XncfBuilderEntities>();

            //指定需要删除的数据实体

            var dropTableKeys = EntitySetKeys.GetEntitySetInfo(this.XncfDatabaseDbContextType).Keys.ToArray();
            //删除数据库表
            await base.DropTablesAsync(serviceProvider, mySenparcEntities, dropTableKeys);

            await base.UninstallAsync(serviceProvider, unsinstallFunc).ConfigureAwait(false);
        }
예제 #2
0
        public override async Task UninstallAsync(IServiceProvider serviceProvider, Func <Task> unsinstallFunc)
        {
            var mySenparcEntitiesType             = this.TryGetXncfDatabaseDbContextType;
            XncfBuilderEntities mySenparcEntities = serviceProvider.GetService(mySenparcEntitiesType) as XncfBuilderEntities;
            var xncfDbContextType = MultipleDatabasePool.Instance.GetXncfDbContextType(this.GetType());

            //指定需要删除的数据实体
            var dropTableKeys = EntitySetKeys.GetEntitySetInfo(xncfDbContextType).Keys.ToArray();
            //删除数据库表
            await base.DropTablesAsync(serviceProvider, mySenparcEntities, dropTableKeys);

            await base.UninstallAsync(serviceProvider, unsinstallFunc).ConfigureAwait(false);
        }