10 private static readonly Type _referenceGenericBaseType = typeof(
Reference<>);
22 throw new ArgumentNullException(nameof(obj),
23 "Attempted to call '.toReference()' on a null resource.");
27 Type runtimeType = obj.GetType();
28 if (runtimeType == typeof(T))
32 Type runtime_reference_type = _referenceGenericBaseType.MakeGenericTypeFast(runtimeType);
33 return (
IReference<T>)Activator.CreateInstance(runtime_reference_type,
34 new object[] { obj });
Provides the REST request methods available to data endpoints.
static IReference< T > ToReference< T >(this T obj, bool stronglyTyped=false)
Converts this IAPIResource object into a strongly typed reference to that object.
Implements the reference entity interface, with support for resolving references using lazy loading.
Interface for Base class used by all resources.
Base interface for all reference entities.