Skip to content

Commit 518fec0

Browse files
Fix empty model check; misses only complex types
1 parent 968e417 commit 518fec0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Common/src/Common.OData/OData/VersionedODataModelBuilder.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,10 @@ private void BuildModelPerApiVersion(
110110
configurations[j].Apply( builder, apiVersion, routePrefix );
111111
}
112112

113+
const int EntityContainerOnly = 1;
113114
var model = builder.GetEdmModel();
114115
var container = model.EntityContainer;
115-
var empty = !container.EntitySets().Any() &&
116-
!container.Singletons().Any() &&
117-
!container.OperationImports().Any();
116+
var empty = model.SchemaElements.Count() == EntityContainerOnly;
118117

119118
if ( empty )
120119
{

0 commit comments

Comments
 (0)