In Programming EF : DbContext (p66) it says "Entity Framework creates the dynamic proxy for change tracking, it will implement the IEntityWithChangeTracker interface".
As a quick test, it suggests using the below code
// Example 3-18. Testing for a change tracking proxy
private static void TestForChangeTrackingProxy()
{
using (var context = new BreakAwayContext())
{
var destination = context.Destinations.First();
var isProxy = destination is IEntityWithChangeTracker;
Console.WriteLine("Destination is a proxy: {0}", isProxy);
}
However, VS2012 seems to raise a warning for the line [var isProxy = destination is IEntityWithChangeTracker;] complaining that : Suspicious type check: there is no type in the solution which is inherited from both (a reference to my class and to IEntityWithChangeTracker"
At runtime although the destination is in fact a generated proxy, the expression (destination is IEntityWithChangeTracker) returns False !
Am I missing anything ?
THanks for any guidance or suggestions.












