Esempio n. 1
0
 /// <summary>
 /// Returns the RDF schema type for the specified entity interface or implementation type
 /// </summary>
 /// <param name="type">The entity interface or implementation type</param>
 /// <returns>The schema type URI for the entity type</returns>
 /// <exception cref="MappingNotFoundException">Raised if no mapping is found for <paramref name="type"/></exception>
 public string MapTypeToUri(Type type)
 {
     if (EntityMappingStore.IsMappedImplementation(type))
     {
         return(EntityMappingStore.GetMappedInterfaceTypeUri(type));
     }
     if (EntityMappingStore.IsKnownInterface(type))
     {
         return(EntityMappingStore.GetMappedInterfaceTypeUri(EntityMappingStore.GetImplType(type)));
     }
     throw new MappingNotFoundException(type);
 }
Esempio n. 2
0
 /// <summary>
 /// Returns true if <paramref name="o"/> is an instance of one of the entity implementation types known to this context
 /// </summary>
 /// <param name="o">The object to be checked</param>
 /// <returns>True if the object is an instance of a known entity implementation type, false otherwise</returns>
 public bool IsOfMappedType(object o)
 {
     return(EntityMappingStore.IsKnownInterface(o.GetType()) || EntityMappingStore.IsMappedImplementation(o.GetType()));
 }