Feature: Repository Monitor

Cached Job Index, Live Job Message Update
This commit is contained in:
Gary Sharp
2013-04-11 19:10:38 +10:00
parent b5531e64bd
commit b79723d432
34 changed files with 803 additions and 262 deletions
+19
View File
@@ -68,5 +68,24 @@ namespace Disco.Data.Repository
modelBuilder.Entity<DeviceProfile>().Property(DeviceProfile.PropertyAccessExpressions.DistributionTypeDb);
}
// Hook for Repository Monitor
public override int SaveChanges()
{
int changeCount = 0;
// Notify before changes are committed
var changes = Monitor.RepositoryMonitor.BeforeSaveChanges(this);
changeCount = base.SaveChanges();
if (changes.Length > 0)
{
// Notify after changes are committed
Monitor.RepositoryMonitor.AfterSaveChanges(this, changes);
}
return changeCount;
}
}
}