src/ActionProviderImplementation/ActionFactory.cs
/// <summary>
/// Given a type try to find the resource set.
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
Given a type try to find the resource set.
Given a type try to find the resource set .
private ResourceSet? GetResourceSet(ResourceType? type)
	{
		if (type == null)
		{
			return null;
		}
		else if (type.ResourceTypeKind == ResourceTypeKind.EntityCollection)
		{
			var ecType = type as EntityCollectionResourceType;
			return GetResourceSet(ecType.ItemType);
		}
		else if (type.ResourceTypeKind == ResourceTypeKind.EntityType)
		{
			var set = _metadata.ResourceSets.SingleOrDefault(rs => rs.ResourceType == type);
			if (set != null)
			{
				return set;
			}
			else if (type.BaseType != null)
			{
				return GetResourceSet(type.BaseType);
			}
		}
		return null;
	}
private ResourceSet ? GetResourceSet ( ResourceType ? type ) { if ( type == null ) { return null ; } else if ( type . ResourceTypeKind == ResourceTypeKind . EntityCollection ) { var ecType = type as EntityCollectionResourceType ; return GetResourceSet ( ecType . ItemType ) ; } else if ( type . ResourceTypeKind == ResourceTypeKind . EntityType ) { var set = _metadata . ResourceSets . SingleOrDefault ( rs => rs . ResourceType == type ) ; if ( set != null ) { return set ; } else if ( type . BaseType != null ) { return GetResourceSet ( type . BaseType ) ; } } return null ; }
Given a type try to find the resource set.
Given a type try to find the resource set .
None
type
ResourceType?
None