Skip to content

IsNotFilterable and derived entities #1539

@CaringDev

Description

@CaringDev

How can I make a derived property not filterable?

Given

public class Base
{
    public int Prop { get; }
}

public class Derived : Base;

I would expect configuring the base entity to be good enough, but:

var builder = new ODataModelBuilder();
var baseType = builder.EntityType<Base>();
baseType.Property(b => b.Prop).IsNotFilterable();
var derived = builder.EntityType<Derived>().DerivesFrom<Base>();

leaves Prop filterable. Other attempts fail as well:

// Cannot redefine property 'Prop'...
// derived.Property(d => d.Prop).IsNotFilterable();

// doesn't do anything
derived.Filter(false, "Prop");

What am I missing?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions