private static SemanticInfo RegisterModelType(Type modelType)
{
using (new Tracer(modelType))
{
SemanticInfo semanticInfo = ExtractSemanticInfo(modelType);
_modelTypeToSemanticInfoMapping.Add(modelType, semanticInfo);
foreach (string semanticTypeName in semanticInfo.MappedSemanticTypes)
{
ISet<Type> mappedModelTypes;
if (!_semanticTypeToModelTypesMapping.TryGetValue(semanticTypeName, out mappedModelTypes))
{
mappedModelTypes = new HashSet<Type>();
_semanticTypeToModelTypesMapping.Add(semanticTypeName, mappedModelTypes);
}
mappedModelTypes.Add(modelType);
}
if (semanticInfo.PublicSemanticTypes.Any())
{
Log.Debug("Model type '{0}' has semantic type(s) '{1}'.", modelType.FullName, string.Join(" ", semanticInfo.PublicSemanticTypes));
foreach (KeyValuePair<string, IList<string>> kvp in semanticInfo.SemanticProperties)
{
Log.Debug("\tRegistered property '{0}' as semantic property '{1}'", kvp.Key, string.Join(" ", kvp.Value));
}
}
return semanticInfo;
}
}