in src/Readers/Vipr.Reader.OData.v4/OdcmReader.cs [550:587]
private void WriteProperty(OdcmClass odcmClass, IEdmEntitySet entitySet)
{
try
{
var navPropBindings = GetNavigationPropertyBindings(entitySet);
var odcmType = ResolveType(entitySet.EntityType().Name, entitySet.EntityType().Namespace);
var odcmProperty = new OdcmEntitySet(entitySet.Name, navPropBindings)
{
Class = odcmClass,
IsCollection = true,
IsLink = true
};
odcmProperty.Projection = new OdcmProjection
{
Type = odcmType,
BackLink = odcmProperty
};
try
{
_propertyCapabilitiesCache.Add(odcmProperty, OdcmCapability.DefaultEntitySetCapabilities);
}
catch (InvalidOperationException e)
{
Logger.Warn("Failed to add property to cache", e);
}
AddVocabularyAnnotations(odcmProperty, entitySet);
odcmClass.Properties.Add(odcmProperty);
}
// If we hit an invalid type, skip this property
catch (InvalidOperationException e)
{
Logger.Error("Could not resolve type", e);
}
}