public GetProductsResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _stringSerializer = serializerResolver.Get("String");
     _intSerializer    = serializerResolver.Get("Int");
 }
 public ListAlbumsResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _iDSerializer     = serializerResolver.Get("ID");
     _stringSerializer = serializerResolver.Get("String");
 }
Пример #3
0
 public UpsertHobbyForPersonResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _stringSerializer = serializerResolver.Get("String");
     _floatSerializer  = serializerResolver.Get("Float");
     _intSerializer    = serializerResolver.Get("Int");
 }
 public void Initialize(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _booleanSerializer   = serializerResolver.Get("Boolean");
     _intSerializer       = serializerResolver.Get("Int");
     _needsInitialization = false;
 }
Пример #5
0
 public void Initialize(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _modelIDInputSerializer          = serializerResolver.Get("ModelIDInput");
     _modelPhotoFilterInputSerializer = serializerResolver.Get("ModelPhotoFilterInput");
     _modelStringInputSerializer      = serializerResolver.Get("ModelStringInput");
     _modelStatusInputSerializer      = serializerResolver.Get("ModelStatusInput");
     _needsInitialization             = false;
 }
Пример #6
0
 public GetDocsResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _intSerializer      = serializerResolver.Get("Int");
     _stringSerializer   = serializerResolver.Get("String");
     _booleanSerializer  = serializerResolver.Get("Boolean");
     _longSerializer     = serializerResolver.Get("Long");
     _dateTimeSerializer = serializerResolver.Get("DateTime");
 }
        private IReadOnlyDictionary <string, object?>?SerializeVariables(
            IOperation operation)
        {
            IReadOnlyList <VariableValue> variableValues =
                operation.GetVariableValues();

            if (variableValues.Count > 0)
            {
                var map = new Dictionary <string, object?>();

                foreach (VariableValue variableValue in variableValues)
                {
                    IValueSerializer serializer =
                        _valueSerializers.Get(variableValue.TypeName);

                    map.Add(
                        variableValue.Name,
                        SerializeVariable(variableValue.Value, serializer));
                }

                return(map);
            }

            return(null);
        }
 public SendMessageResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _dateTimeSerializer = serializerResolver.Get("DateTime");
 }
Пример #9
0
 public RegisterStudentResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _uuidSerializer = serializerResolver.Get("Uuid");
 }
 public DeleteProductMutationResultParser(IValueSerializerCollection serializerResolver)
 {
     if (serializerResolver is null)
     {
         throw new ArgumentNullException(nameof(serializerResolver));
     }
     _booleanSerializer = serializerResolver.Get("Boolean");
 }