File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010using System . Reflection ;
1111using System . Collections ;
1212using System . Data . Entity . Core ;
13+ using JSONAPI . Extensions ;
1314
1415namespace JSONAPI . EntityFramework
1516{
@@ -163,15 +164,7 @@ private bool IsMany(Type type)
163164
164165 public bool IsModel ( Type objectType )
165166 {
166- if ( objectType . IsPrimitive
167- || typeof ( System . Guid ) . IsAssignableFrom ( objectType )
168- || typeof ( System . DateTime ) . IsAssignableFrom ( objectType )
169- || typeof ( System . DateTimeOffset ) . IsAssignableFrom ( objectType )
170- || typeof ( System . Guid ? ) . IsAssignableFrom ( objectType )
171- || typeof ( System . DateTime ? ) . IsAssignableFrom ( objectType )
172- || typeof ( System . DateTimeOffset ? ) . IsAssignableFrom ( objectType )
173- || typeof ( String ) . IsAssignableFrom ( objectType )
174- )
167+ if ( objectType . CanWriteAsJsonApiAttribute ( ) )
175168 return false ;
176169 else return true ;
177170 }
Original file line number Diff line number Diff line change 22
33namespace JSONAPI . Extensions
44{
5- internal static class TypeExtensions
5+ public static class TypeExtensions
66 {
7- internal static bool CanWriteAsJsonApiAttribute ( this Type objectType )
7+ public static bool CanWriteAsJsonApiAttribute ( this Type objectType )
88 {
99 if ( objectType . IsGenericType && objectType . GetGenericTypeDefinition ( ) == typeof ( Nullable < > ) )
1010 objectType = objectType . GetGenericArguments ( ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments