public void SetRequestBuilder(Type linkType, DelegatingRequestBuilder builder) { var t = (ILink)Activator.CreateInstance(linkType); var reg = _LinkRegistry[t.Relation]; reg.RequestBuilder = builder; }
public void AddRequestBuilder(DelegatingRequestBuilder requestBuilder) { if (_httpRequestBuilder != null) { _httpRequestBuilder.NextBuilder = requestBuilder; } else { _httpRequestBuilder = requestBuilder; } }
public void SetRequestBuilder <T>(IEnumerable <DelegatingRequestBuilder> builders) where T : ILink, new() { var t = new T(); var reg = _LinkRegistry[t.Relation]; DelegatingRequestBuilder currentBuilder = null; foreach (var requestBuilder in builders.Reverse()) { requestBuilder.NextBuilder = currentBuilder; currentBuilder = requestBuilder; } reg.RequestBuilder = currentBuilder; }
public void SetRequestBuilder <T>(DelegatingRequestBuilder builder) where T : ILink, new() { SetRequestBuilder <T>(new [] { builder }); }
public Link() { Method = HttpMethod.Get; Relation = LinkHelper.GetLinkRelationTypeName(GetType()); _httpRequestBuilder = new DefaultRequestBuilder(); }