예제 #1
0
 public JsonLdCodec(IUriResolver uris, ICommunicationContext context, IMetaModelRepository models,
                    IResponse responseMessage)
 {
     _uris                 = uris;
     _context              = context;
     _models               = models;
     _responseMessage      = responseMessage;
     _apiDocumentationLink = uris.CreateUriFor <ApiDocumentation>();
 }
예제 #2
0
        public string CreateUri <T>(Uri baseUri)
        {
            if (_generators.TryGetValue(typeof(T), out var generator))
            {
                return(baseUri + generator(null).Substring(1));
            }

            return(_uris.CreateUriFor(baseUri, typeof(T)).ToString());
        }
예제 #3
0
 public static Uri CreateUriFor(this IUriResolver resolver, Uri baseAddress, Type resourceType, NameValueCollection nameValues)
 {
     return(resolver.CreateUriFor(baseAddress, resourceType, "", nameValues));
 }
예제 #4
0
 public static Uri CreateUriFor(this IUriResolver resolver, Uri baseAddress, Type type, object nameValues)
 {
     return(resolver.CreateUriFor(baseAddress, type, nameValues != null ? nameValues.ToNameValueCollection() : null));
 }
예제 #5
0
 public static Uri CreateUriFor(this IUriResolver resolver, Uri baseAddress, Type type, string uriName)
 {
     return(resolver.CreateUriFor(baseAddress, type, uriName, (NameValueCollection)null));
 }
예제 #6
0
 public static Uri CreateUriFor(this IUriResolver resolver, Uri baseAddress, Type type)
 {
     return(resolver.CreateUriFor(baseAddress, type, (string)null));
 }
예제 #7
0
 public static Uri CreateUriFor <T>(this IUriResolver resolver) => resolver.CreateUriFor(typeof(T));
예제 #8
0
 public void WhenCreatingUriFor <TResource>()
 {
     ThenTheUri = UriResolver.CreateUriFor(typeof(TResource));
 }
예제 #9
0
 public static Uri CreateUriFor(this IUriResolver resolver, Type type, object keyValues)
 {
     return(resolver.CreateUriFor(type, keyValues != null ? keyValues.ToNameValueCollection() : null));
 }
예제 #10
0
 public static Uri CreateUriFor(this IUriResolver resolver, Uri baseAddress, Type type, object nameValues) =>
 resolver.CreateUriFor(baseAddress, type, nameValues?.ToNameValueCollection());
예제 #11
0
 public static Uri CreateUriFor(this IUriResolver resolver, Uri baseAddress, Type type, string uriName) =>
 resolver.CreateUriFor(baseAddress, type, uriName, null);
예제 #12
0
 // ReSharper disable once MemberCanBePrivate.Global
 public static Uri CreateUriFor(this IUriResolver resolver, Type type, string uriName,
                                NameValueCollection keyValues) =>
 resolver.CreateUriFor(null, type, uriName, keyValues);
예제 #13
0
 public static Uri CreateUriFor(this IUriResolver resolver, Type type, string uriName, object keyValues) =>
 resolver.CreateUriFor(type, uriName, keyValues?.ToNameValueCollection());
예제 #14
0
 public static Uri CreateUriFor(this IUriResolver resolver, Type type) => resolver.CreateUriFor(type, null);
예제 #15
0
 public static Uri CreateUriFor <T>(this IUriResolver resolver)
 {
     return(resolver.CreateUriFor(typeof(T)));
 }
예제 #16
0
 public static Uri CreateUriFor(this IUriResolver resolver, Type type)
 {
     return(resolver.CreateUriFor(type, null));
 }
 public Uri CreateUriFor(Uri baseAddress, object resourceKey, string uriName, NameValueCollection keyValues)
 {
     return(_inner.CreateUriFor(baseAddress ?? _ctx().ApplicationBaseUri, resourceKey, uriName, keyValues));
 }
예제 #18
0
 public static Uri CreateUriFor(this IUriResolver resolver, Type type, NameValueCollection keyValues)
 {
     return(resolver.CreateUriFor(type, null, keyValues));
 }
예제 #19
0
 public void GenerateStringUriTemplatesFromTypes()
 {
     uriResolver.CreateUriFor(LocalHost, typeof(EventMappedWithStrings), new EventMappedWithStrings(1));
 }
예제 #20
0
 public Uri Create <T>()
 {
     return(resolver.CreateUriFor <T>());
 }
예제 #21
0
 public static Uri CreateUriFor(this IUriResolver resolver, Type type, string uriName, NameValueCollection keyValues)
 {
     return(resolver.CreateUriFor(DependencyManager.GetService <ICommunicationContext>().ApplicationBaseUri, type, uriName,
                                  keyValues));
 }