Ejemplo n.º 1
0
        protected Extension(
            string schemaIdentifier,
            string typeName,
            string path,
            Type controller,
            JsonDeserializingFactory jsonDeserializingFactory)
        {
            if (string.IsNullOrWhiteSpace(schemaIdentifier))
            {
                throw new ArgumentNullException(Extension.ArgumentNameSchemaIdentifier);
            }

            if (string.IsNullOrWhiteSpace(typeName))
            {
                throw new ArgumentNullException(Extension.ArgumentNameTypeName);
            }

            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException(Extension.ArgumentNamePath);
            }

            this.SchemaIdentifier         = schemaIdentifier;
            this.TypeName                 = typeName;
            this.Path                     = path;
            this.Controller               = controller ?? throw new ArgumentNullException(Extension.ArgumentNameController);
            this.JsonDeserializingFactory = jsonDeserializingFactory ?? throw new ArgumentNullException(Extension.ArgumentNameJsonDeserializingFactory);
        }
Ejemplo n.º 2
0
        public SchematizedMediaTypeFormatter(
            IMonitor monitor,
            JsonDeserializingFactory <Schematized> deserializingFactory)
        {
            this.Monitor = monitor ?? throw new ArgumentNullException(nameof(monitor));

            this.SupportedMediaTypes.Add(SchematizedMediaTypeFormatter.MediaTypeHeaderJavaWebToken.Value);
            this.SupportedMediaTypes.Add(SchematizedMediaTypeFormatter.MediaTypeHeaderJson.Value);
            this.SupportedMediaTypes.Add(SchematizedMediaTypeFormatter.MediaTypeHeaderProtocol.Value);
            this.SupportedMediaTypes.Add(SchematizedMediaTypeFormatter.MediaTypeHeaderStream.Value);

            this.DeserializingFactory = deserializingFactory ?? throw new ArgumentNullException(nameof(deserializingFactory));
        }
Ejemplo n.º 3
0
 public QueryResponseJsonDeserializingFactory(JsonDeserializingFactory <Schematized> jsonDeserializingFactory)
 {
     this.JsonDeserializingFactory =
         jsonDeserializingFactory ?? throw new ArgumentNullException(nameof(jsonDeserializingFactory));
 }