Support forum for ASP.NET Zero (
By RattleHub
#26027 Is it possible to overide the save on the database context. We have a custon attribute that we need to check if the value has the attribute defined and then modify the data. Could you advise me the best way to do this.

We are basically looking to implememnt something like this where we can see if a Encryped attribute is set and then if need be encrypt the data
User avatar
By aaron
#26042 Yes, you can override SaveChanges().

Are you using EF Core? If yes, then the main difference is:

Code: Select allvar pendingEntities = ChangeTracker.Entries()
    .Where(e => e.State == EntityState.Added || e.State == EntityState.Modified)

You can try that and let us know what errors you get.