protected override HttpStatusCode ProcessRequestInternal(HttpContext context, VivendiResource resource) { // return the resource switch (resource) { case VivendiCollection collection: WriteCollection(context, collection); break; case VivendiDocument document: WriteDocument(context, document); break; default: return(HttpStatusCode.NotImplemented); } return(HttpStatusCode.OK); }
public static Uri GetHref(this HttpContext context, VivendiResource resource) { // get the suffix and prefix var suffix = resource.Path; var prefix = context.Request.ApplicationPath; var path = new StringBuilder(); // append the paths if they are not roots if (prefix.Length > 1) { path.Append(prefix); } if (suffix.Length > 1) { path.Append(suffix); } // terminate collections with a trailing slash and return the URI if (resource is VivendiCollection) { path.Append("/"); } return(new Uri(context.Request.Url, path.ToString())); }
public static Uri GetRelativeHref(this HttpContext context, VivendiResource resource) => context.Request.Url.MakeRelativeUri(context.GetHref(resource));
protected override HttpStatusCode ProcessRequestInternal(HttpContext context, VivendiResource resource) => HttpStatusCode.OK;
public override void Get(VivendiResource resource, XmlElement value) => _getter(resource as T ?? throw new ArgumentOutOfRangeException("resource"), value);
public abstract void Set(VivendiResource resource, XmlElement value);
public abstract bool IsApplicable(VivendiResource resource);
protected abstract HttpStatusCode ProcessRequestInternal(HttpContext context, VivendiResource resource);