public ProtoBufOutputFormatter(ProtoBufFormatterOptions options, MvcOptions mvcOptions)
        {
            _mvcOptions = mvcOptions;

            foreach (var contentType in options.SupportedContentTypes)
            {
                SupportedMediaTypes.Add(new MediaTypeHeaderValue(contentType));
            }
        }
Пример #2
0
        public ProtoBufInputFormatter(ProtoBufFormatterOptions options, MvcOptions mvcOptions, ILogger <ProtoBufInputFormatter> logger)
        {
            _mvcOptions = mvcOptions;
            _logger     = logger ?? (ILogger)NullLogger.Instance;

            foreach (var contentType in options.SupportedContentTypes)
            {
                SupportedMediaTypes.Add(new MediaTypeHeaderValue(contentType));
            }
        }