Search code examples
c#entity-frameworkowinasp.net-identity-2tracker-enabled-dbcontext

Combine IdentityDbContext and TrackerContext


I have an existing EF-Project which uses "Tracker Enabled DbContext". To work with this package I have to derive from its "TrackerContext":

public class MyContext : TrackerContext {}

TrackContext itself derives from DBContext:

public class TrackerContext : DbContext, ITrackerContext, IDbContext, IDisposable

(info from metadata)

Now I want to add Identity to my project (OWIN). For this to happen I have to derive from IdentityDBContext:

 public class MyContext: IdentityDbContext<UserOwin> 

So I am in a bit of a dilemma here: How can I use AspNetIdentity without losing the Tracking functionality?


Solution

  • Solved this. There is a nuget-package for exactly that specific issue:

    TrackerEnabledDbContext.Identity