Skip to content

Commit d36ec48

Browse files
LuukN2commonsensesoftware
authored andcommitted
Removed DeclaringType and references.
1 parent 7a33bc5 commit d36ec48

File tree

5 files changed

+3
-40
lines changed

5 files changed

+3
-40
lines changed

src/Common.OData.ApiExplorer/AspNet.OData/ClassProperty.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,10 @@ public Type GetType( Type declaringType )
4343
Contract.Requires( declaringType != null );
4444
Contract.Ensures( Contract.Result<Type>() != null );
4545

46-
if ( type == DeclaringType.Value )
47-
{
48-
return declaringType;
49-
}
50-
else if ( type.IsGenericType )
46+
if ( type.IsGenericType )
5147
{
5248
var typeArgs = type.GetGenericArguments();
53-
54-
if ( typeArgs.Length == 1 && typeArgs[0] == DeclaringType.Value )
55-
{
56-
return type.GetGenericTypeDefinition().MakeGenericType( declaringType );
57-
}
49+
return type.GetGenericTypeDefinition().MakeGenericType( declaringType );
5850
}
5951

6052
return type;

src/Common.OData.ApiExplorer/AspNet.OData/DeclaringType.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/Common.OData.ApiExplorer/AspNet.OData/DefaultModelTypeBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public Type NewStructuredType( IEdmStructuredType structuredType, Type clrType,
136136
}
137137
}
138138

139-
clrTypeMatchesEdmType &= propertyType.IsDeclaringType() || property.PropertyType.Equals( propertyType );
139+
clrTypeMatchesEdmType &= property.PropertyType.Equals( propertyType );
140140
properties.Add( new ClassProperty( property, propertyType ) );
141141
}
142142

src/Common.OData.ApiExplorer/AspNet.OData/TypeExtensions.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,25 +82,6 @@ internal static void Deconstruct<T1, T2>( this Tuple<T1, T2> tuple, out T1 item1
8282
item2 = tuple.Item2;
8383
}
8484

85-
internal static bool IsDeclaringType( this Type type )
86-
{
87-
Contract.Requires( type != null );
88-
89-
if ( type == DeclaringType.Value )
90-
{
91-
return true;
92-
}
93-
94-
if ( !type.IsGenericType )
95-
{
96-
return false;
97-
}
98-
99-
var typeArgs = type.GetGenericArguments();
100-
101-
return typeArgs.Length == 1 && typeArgs[0] == DeclaringType.Value;
102-
}
103-
10485
static bool IsSubstitutableGeneric( Type type, Stack<Type> openTypes, out Type innerType )
10586
{
10687
Contract.Requires( type != null );

src/Common.OData.ApiExplorer/Common.OData.ApiExplorer.projitems

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<ItemGroup>
1212
<Compile Include="$(MSBuildThisFileDirectory)AspNet.OData\ClassProperty.cs" />
1313
<Compile Include="$(MSBuildThisFileDirectory)AspNet.OData\ClassSignature.cs" />
14-
<Compile Include="$(MSBuildThisFileDirectory)AspNet.OData\DeclaringType.cs" />
1514
<Compile Include="$(MSBuildThisFileDirectory)AspNet.OData\EdmTypeKey.cs" />
1615
<Compile Include="$(MSBuildThisFileDirectory)AspNet.OData\IModelTypeBuilder.cs" />
1716
<Compile Include="$(MSBuildThisFileDirectory)AspNet.OData\DefaultModelTypeBuilder.cs" />

0 commit comments

Comments
 (0)