/// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="actionResultExecutor"></param>
        /// <param name="errorHandler"></param>
        /// <param name="contentSerializers"></param>
        public ContentSerializationService(ICustomActionResultExecutor actionResultExecutor, IErrorHandler errorHandler, IEnumerable <IContentSerializer> contentSerializers)
        {
            _actionResultExecutor = actionResultExecutor;
            _errorHandler         = errorHandler;

            _contentSerializers = contentSerializers.ToList();
            _contentSerializers.Reverse();

            if (_contentSerializers.Count == 1)
            {
                _serializer = _contentSerializers[0];
            }
            else
            {
                _defaultSerializer = _contentSerializers.FirstOrDefault(s => s.IsDefault);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="actionResultExecutor"></param>
 public RawContentWriter(ICustomActionResultExecutor actionResultExecutor)
 {
     _actionResultExecutor = actionResultExecutor;
 }