private void CheckInitializerType(Type type)
{
// nominal types are not supported
TypeUsage typeUsage;
if (_funcletizer.RootContext.Perspective.TryGetType(type, out typeUsage))
{
var typeKind = typeUsage.EdmType.BuiltInTypeKind;
if (BuiltInTypeKind.EntityType == typeKind
||
BuiltInTypeKind.ComplexType == typeKind)
{
throw new NotSupportedException(
Strings.ELinq_UnsupportedNominalType(
typeUsage.EdmType.FullName));
}
}
// types implementing IEnumerable are not supported
if (TypeSystem.IsSequenceType(type))
{
throw new NotSupportedException(
Strings.ELinq_UnsupportedEnumerableType(
DescribeClrType(type)));
}
}