protected override void Down(MigrationBuilder migrationBuilder) { using (var db = new AumentumSecurityContext()) { var permission = db.Permissions.Single(x => x.AppFunctionType == "field" && x.ParentName == ApiGrmEventServiceName && x.Name == PermissionSeeder.ToResourceName(AumentumSecurityObjectModel.GRMEventSecurityObjectModel.Resources.SubComponentValues)); db.Permissions.Remove(permission); db.SaveChanges(); } }
protected override void Down(MigrationBuilder migrationBuilder) { using (var db = new AumentumSecurityContext()) { var baseValueSegmentServiceApplication = db.Permissions.Single(p => p.Name == "api.BaseValueSegmentService" && p.AppFunctionType == "Application" && p.App == "api.BaseValueSegmentService"); var name = PermissionSeeder.ToResourceName( AumentumSecurityObjectModel.BaseValueSegementSecurityObjectModel.Resources.Flags); var permission = db.Permissions.Single( x => x.ParentId == baseValueSegmentServiceApplication.Id && x.Name == name && x.AppFunctionType == "field"); db.Permissions.Remove(permission); db.SaveChanges(); } }