public override Task InstalledAsync(IFeatureEventContext context) { return(Task.CompletedTask); }
public override async Task InstalledAsync(IFeatureEventContext context) { await InitializeDefaultFeatureSettings(context); }
public override async Task InstalledAsync(IFeatureEventContext context) { // Apply default permissions to default roles for new feature await _defaultRolesManager.UpdateDefaultRolesAsync(new Permissions()); }
public override async Task UpdatedAsync(IFeatureEventContext context) { // Apply any additional permissions to default roles for updated feature await _defaultRolesManager.UpdateDefaultRolesAsync(new Permissions()); }
public override async Task InstalledAsync(IFeatureEventContext context) { await _defaultCategoryRolesManager.InstallAsync(); }
public override async Task UninstallingAsync(IFeatureEventContext context) { if (context.Logger.IsEnabled(LogLevel.Information)) { context.Logger.LogInformation($"UninstallingAsync called within {ModuleId}"); } using (var builder = _schemaBuilder) { // drop categories builder.TableBuilder.DropTable(_categories); builder.ProcedureBuilder .DropDefaultProcedures(_categories) .DropProcedure(new SchemaProcedure("SelectCategoriesPaged", StoredProcedureType.SelectByKey)) .DropProcedure(new SchemaProcedure("SelectCategoriesByFeatureId", StoredProcedureType.SelectByKey)); // drop category data builder.TableBuilder.DropTable(_categoryData); builder.ProcedureBuilder .DropDefaultProcedures(_categoryData) .DropProcedure(new SchemaProcedure("SelectCategoryDatumByCategoryId")) .DropProcedure(new SchemaProcedure("SelectCategoryDatumPaged")); // drop category roles builder.TableBuilder.DropTable(_categoryRoles); builder.ProcedureBuilder .DropDefaultProcedures(_categoryRoles) .DropProcedure(new SchemaProcedure("SelectCategoryRolesByCategoryId")) .DropProcedure(new SchemaProcedure("SelectCategoryRolesPaged")) .DropProcedure(new SchemaProcedure("DeleteCategoryRolesByCategoryId")) .DropProcedure(new SchemaProcedure("DeleteCategoryRolesByRoleIdAndCategoryId")); // drop entity categories builder.TableBuilder.DropTable(_entityCategories); builder.ProcedureBuilder .DropDefaultProcedures(_entityCategories) .DropProcedure(new SchemaProcedure("SelectEntityCategoriesByEntityId")) .DropProcedure(new SchemaProcedure("SelectEntityCategoryByEntityIdAndCategoryId")) .DropProcedure(new SchemaProcedure("DeleteEntityCategoriesByEntityId")) .DropProcedure(new SchemaProcedure("DeleteEntityCategoryByEntityIdAndCategoryId")) .DropProcedure(new SchemaProcedure("SelectEntityCategoriesPaged")); // Log statements to execute if (context.Logger.IsEnabled(LogLevel.Information)) { context.Logger.LogInformation($"The following SQL statements will be executed..."); foreach (var statement in builder.Statements) { context.Logger.LogInformation(statement); } } // Execute statements var errors = await _schemaManager.ExecuteAsync(builder.Statements); foreach (var error in errors) { context.Logger.LogCritical(error, $"An error occurred within the UninstallingAsync method within {this.GetType().FullName}"); context.Errors.Add(error, $"UninstallingAsync within {this.GetType().FullName}"); } } }
public virtual Task InstallingAsync(IFeatureEventContext context) { return(Task.CompletedTask); }
public virtual Task UpdatedAsync(IFeatureEventContext context) { return(Task.CompletedTask); }