示例#1
0
 private string GetContentTypeHeader(ContentMicrotypeDescriptor contentDescriptor, IEnumerable <RuntimeMicrotypeDescriptor> runtimeDescriptors)
 {
     return(new IMicrotypeDescriptor[] { contentDescriptor }
            .Concat(runtimeDescriptors)
            .Aggregate(
                seed: new StringBuilder("application/vnd.microtypes-container+json"),
                func: (builder, descriptor) => builder
                .Append(';')
                .Append(descriptor.Category)
                .Append('=')
                .Append(descriptor.Identifier),
                resultSelector: builder => builder.ToString()));
 }
 public bool AcceptsContentMicrotype(ContentMicrotypeDescriptor microtype)
 => true;
示例#3
0
 public MicrotypeRegistry RegisterContentMicrotype(ContentMicrotypeDescriptor descriptor)
 {
     _content.Add(descriptor);
     return(this);
 }
 public bool AcceptsContentMicrotype(ContentMicrotypeDescriptor microtype)
 => microtype.Identifier == "json-home";