Exemplo n.º 1
0
 internal static IEnumerable <T> Cast <T>(JsonApiResourceObject data, JsonApiResource apiResource)
 {
     return(new List <T> {
         (T)data.ToObject(apiResource, typeof(T))
     });
 }
Exemplo n.º 2
0
 public static T_Result ToObject <T_Result, T_Resource>(this JsonApiResourceObject resourceObject, T_Resource resource) where T_Resource : JsonApiResource
 {
     return((T_Result)resourceObject.ToObject(resource, typeof(T_Result)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Converts the resource to a object.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static T ToObject <T>(this JsonApiResourceObject resourceObject, bool processRelations = true) where T : IJsonApiDataModel
 {
     return((T)resourceObject.ToObject(typeof(T), processRelations));
 }
Exemplo n.º 4
0
 public static T_Result ToObject <T_Result, T_Resource>(this JsonApiResourceObject resourceObject) where T_Resource : JsonApiResource
 {
     return((T_Result)resourceObject.ToObject(Activator.CreateInstance <T_Resource>(), typeof(T_Result)));
 }