So I have a simple class that represents data from the database.
public class EntitySyncContext
{
public EntitySyncContext()
{
ExternalEntities = new List<ExternalContact>();
}
public HandledType HandledType { get; set; }
public Contact Entity { get; set; }
public IList<ExternalContact> ExternalEntities { get; set; }
public bool HasConflict { get; set; }
}
But when I declare a variable from this class, when I put a watch on it while debugging I see that all of the properties that are listed above exist twice within the variable.
EntitySyncContext matchingContext = new EntitySyncContext();
Does anyone know how and/or why this happens and/or how to fix it?
I only have VIsual Studio 2015 installed right now so behavior may be different but it got me thinking about a couple of things.
Look at this code here:
public interface IA
{
string StringA { get; }
}
public interface IB
{
string StringA { get; }
}
public class B
{
public string StringA { get; }
}
public class A : B, IA, IB
{
public string StringA
{
get
{
return "A";
}
}
string IB.StringA
{
get
{
return "B";
}
}
}
Here is what watching an instance of class A looks like in Visual Studio 2015:
So my thinking is that you have either explicitly implemented interfaces that have the same properties, or you could be hiding properties of a base class by declaring properties by the same name in a subclass, and Visual Studio 2013 either doesn't display the extra type detail that 2015 does, or you have it configured differently than I do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With