File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99using System . Reflection ;
1010using System . Collections ;
1111using System . Data . Entity . Core ;
12+ using JSONAPI . Extensions ;
1213
1314namespace JSONAPI . EntityFramework
1415{
@@ -170,15 +171,7 @@ private bool IsMany(Type type)
170171
171172 public bool IsModel ( Type objectType )
172173 {
173- if ( objectType . IsPrimitive
174- || typeof ( System . Guid ) . IsAssignableFrom ( objectType )
175- || typeof ( System . DateTime ) . IsAssignableFrom ( objectType )
176- || typeof ( System . DateTimeOffset ) . IsAssignableFrom ( objectType )
177- || typeof ( System . Guid ? ) . IsAssignableFrom ( objectType )
178- || typeof ( System . DateTime ? ) . IsAssignableFrom ( objectType )
179- || typeof ( System . DateTimeOffset ? ) . IsAssignableFrom ( objectType )
180- || typeof ( String ) . IsAssignableFrom ( objectType )
181- )
174+ if ( objectType . CanWriteAsJsonApiAttribute ( ) )
182175 return false ;
183176 else return true ;
184177 }
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