I want to change the namespace of all entities exposed by my ODATA service.
Right now they've got: Core.DomainModel.Entities.Database
which is a bit long when consuming it.
I've tried to set it via builder.Namespace = "MyModel";
but that had no effect.
var builder = new ODataConventionModelBuilder();
builder.Namespace = "MyModel";
I then figured I had to set it on each entity like so
builder.EntitySet<Foo>("Foo").EntityType.Namespace = "MyModel";
But that quickly gets out of hand, when I have to go through EVERY entity :(
Then I tried this
foreach (var entity in builder.EntitySets)
{
entity.EntityType.Namespace = "MyModel";
}
But that doesn't include everything either. I noticed that ENUMs, ComplexTypes and some entities didn't get the right namespace... :/
So my question is. How do I set the namespace for every entity?