You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Car
{
public Car()
{
Bag = new Dictionary<string, object>();
}
public IDictionary<string, object> Bag { get; }
}
I want to ignore all changes in the Bag. I expected this to work
[Fact]
public void Ignore_ShouldIgnoreCollections()
{
var original = new Car();
var current = new Car();
current.Bag["foo"] = "bar";
var configuration = new Configuration();
configuration.Configure(config => config
.Entity<Car>(e =>
{
e.Property(p => p.Bag).Ignore();
//e.Collection(p => p.Bag).Ignore();
}));
var comparer = new EntityComparer(configuration);
var changes = comparer.Compare(original, current);
changes.Count.Should().Be(0);
}
But I get 1 diff. The commented out Ignore() does not help either.
I believe the error may be in EntityComparer.CompareObject. Changing the loop as below fixes the issue, but I don't know if there are other ramifications.
foreach (var memberMapping in classMapping.Members)
{
if (memberMapping.Ignored)
continue;
The text was updated successfully, but these errors were encountered:
Given a model
I want to ignore all changes in the Bag. I expected this to work
But I get 1 diff. The commented out
Ignore()
does not help either.I believe the error may be in
EntityComparer.CompareObject
. Changing the loop as below fixes the issue, but I don't know if there are other ramifications.The text was updated successfully, but these errors were encountered: