// PUBLIC METHODS /////////////////////////////////////////////////// #region Factory Methods public static IToOneResourceLinkage <TFromResource, TToResource> Create <TFromResource, TToResource>(TFromResource fromResource, string fromRel, TToResource toResource) where TFromResource : class, IResource where TToResource : class, IResource { Contract.Requires(fromResource != null); Contract.Requires(String.IsNullOrWhiteSpace(fromRel)); var toOneResourceLinkage = new ToOneResourceLinkage <TFromResource, TToResource>(fromResource, fromRel, toResource); return(toOneResourceLinkage); }
// PUBLIC METHODS /////////////////////////////////////////////////// #region Extension Methods public static IToOneResourceLinkageBuilder <TToResource> ToOne <TFromResource, TToResource>(this IIncludedResourcesBuilder includedResourcesBuilder, TFromResource fromResource, string fromRel, TToResource toResource) where TFromResource : class, IResource where TToResource : class, IResource { Contract.Requires(includedResourcesBuilder != null); Contract.Requires(fromResource != null); Contract.Requires(String.IsNullOrWhiteSpace(fromRel)); var toOneResourceLinkage = new ToOneResourceLinkage <TFromResource, TToResource>(fromResource, fromRel, toResource); return(includedResourcesBuilder.ToOne(toOneResourceLinkage)); }
// PUBLIC METHODS /////////////////////////////////////////////////// #region Properties public static IToOneResourceLinkage Create <TResourceId>(TResourceId resourceId) { var resourceLinkage = new ToOneResourceLinkage <TResourceId>(resourceId); return(resourceLinkage); }