internal static IEnumerable <T> Cast <T>(JsonApiResourceObject data, JsonApiResource apiResource) { return(new List <T> { (T)data.ToObject(apiResource, typeof(T)) }); }
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))); }
/// <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)); }
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))); }