//      Contains information about a particular resource.
/// Use this class to represent a DataService type (primitive, complex or entity).
/// Primitive string resource type.
/// MethodInfo for object DataServiceProviderWrapper.GetPropertyValue(object target, ResourceProperty resourceProperty, ResourceType resourceType).
/// MethodInfo for object IProjectedResult.GetProjectedPropertyValue(this IProjectedResult value, string propertyName).
///  name of the resource.
///  full name of the resource.
///  Namespace for this type.
/// Whether this type is abstract.
/// Whether the resource type has open properties.
/// Whether the corresponding instance type actually represents this node's CLR type.
/// Cached delegate to create a new instance of this type.
/// Cached delegate to serialize parts of this resource into a dictionary.
///  list of etag properties for this type.
/// If ResourceProperty.CanReflectOnInstanceTypeProperty is true, we cache the PropertyInfo object.
/// Indicates whether one of the base class of this resource type has EpmInfo.
/// is true, if the type is set to readonly.
/// True if the virtual load properties is already called, otherwise false.
/// Namespace name of the given resource type.
/// name of the given resource type.
/// whether the resource type is an abstract type or not.
/// Constructs a new instance of Resource type for the given clr primitive type. This constructor must be called only for primitive types.
/// clr type representing the primitive type.
/// namespace of the primitive type.
/// name of the primitive type.
// This is to optimize the string property name in PlainXmlSerializer.WriteStartElementWithType function.
// Checking here is a fixed overhead, and the gain is every time we serialize a string property.
// returned by the virtual method to the properties collection.
// First try and validate the type. If that succeeds, then cache the results. otherwise we need to revert the results.
///  Returns the list of key properties for this type, if this type is entity type.
/// Returns the list of etag properties for this type.
///  Gets the name of the resource.
///  Gets the fullname of the resource.
///  Returns the namespace of this type.
/// Indicates whether this is an abstract type.
/// Indicates whether the resource type has open properties.
// Complex types can not be marked as open.
/// PlaceHolder to hold custom state information about resource type.
/// Returns true, if this resource type has been set to read only. Otherwise returns false.
/// All EpmInfo i.e. both own and inherited.
// only check whether the property with the same name exists in this type.
// we will look in base types properties when the type is sealed.
// add the property to the list of properties declared on this type.
/// Adds an  for the resource type.
// EntityPropertyMapping attribute can not be added to readonly resource types.
/// Make the resource type readonly from now on. This means that no more changes can be made to the resource type anymore.
// We need to set readonly at the start to avoid any circular loops that may result due to navigation properties.
// If there are any exceptions, we need to set readonly to false.
// if the base type is not null, then we need to make sure that there is no property with the same name.
// Mark the current type as being a Media Link Entry if the base type is a Media Link Entry.
// Make sure current type is not a CLR type if base is not a CLR type.
/// By initializing the EpmInfo for the resource type, ensures that the information is available for de-serialization.
// read the type from the payload.
// we create a new instance then apply its property mappings.
// We've already created a new instance of the complex property by now, reuse the same instance.
/// Tries to find the property for the specified name.
/// Name of property to resolve.
/// Resolved property; possibly null.
/// Tries to find the property declared on this type for the specified name.
/// is a subtype of the given type or not.
/// resource type to check.
/// true, if the given type is assignable to this type. Otherwise returns false.
/// Returns the propertyinfo object for the specified resource property.
/// The method searchies this type as well as all its base types for the property.
/// Sets the value of the property.
/// The object whose property needs to be set.
/// new value for the property.
/// metadata for the property to be set.
/// ResourceType.Properties or ResourceType.PropertiesDeclaredOnThisType property is accessed.
/// the list of properties declared on this type.
/// and are alphabetically ordered in case-insensitive ordinal order.
/// First property to compare.
/// Second property to compare.
/// Initializes all properties for the resource type, to be used by Properties getter.
/// Collection of properties exposed by this resource type.
/// property which needs to be added.
/// Property representing the final property in the path.
// If it so happens that the source is a value type, it can't be IProjectedResult anyway.
/// Checks if the resource type is sealed. If not, it throws an InvalidOperationException.
/// adds the properties returned by the method to the list of properties for this type.
// then call the method and update the state to reflect that.
/// This method is called only when the Properties property is called and the type is already set to read-only.
/// This method validates all the properties w.r.t to the base type and calls SetReadOnly on all the properties.
// to multiple ResourceType instances.
// EpmSourceTree and EpmTargetTree may be only half constructed and need to be reset.
/// if inherited EPM attributes exist duplicates will be added.