NEST 7 ConnectionSettings DefaultMappingFor doesn't support base class mapping anymore

After upgrading to NEST 7 I noticed that properties which were ignored in 6.4.2 were no longer ignored. I'm not sure that the it was supposed to work in the first place though.
I've looking though the breaking changes for 7.0 but didn't see anything about this.

If you have a class Status:

public class Status
{
   public string Name { get; set; }
   public string Description { get; set; }
   public string Severity { get; set; }
}

and various sub classes for different objects:

public class OrderStatus : Status
{
}

public class EnquiryStatus : Status
{
}

in 6.4.2 (possibly higher version not tested) one could ignore all status implementations by just configuring the mapping for the base class:

var settings = new ConnectionSettings(pool, connection)
                    .DefaultMappingFor<StatusType>(s => s
                        .Ignore(i => i.Description)
                        .Ignore(i => i.Severity));

but now it seems one must define a mapping for each implementation.
Is there a way to make it work like it did before or must each implementation be defined?

Would you mind opening an issue to discuss? Thanks!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.