Esempio n. 1
0
 public OpenRastaProperties(IDictionary <string, object> startupProperties)
     : base(startupProperties)
 {
     Pipeline    = new PipelineProperties(startupProperties);
     Errors      = new ErrorProperties(startupProperties);
     Diagnostics = new DiagnosticsProperties(startupProperties);
 }
Esempio n. 2
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the value to convert into an instance of <see cref="ErrorProperties" />.</param>
 /// <returns>
 /// an instance of <see cref="ErrorProperties" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public static object ConvertFrom(dynamic sourceValue)
 {
     if (null == sourceValue)
     {
         return(null);
     }
     try
     {
         ErrorProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());
     }
     catch
     {
         // Unable to use JSON pattern
     }
     try
     {
         return(new ErrorProperties
         {
             Code = sourceValue.Code,
             Message = sourceValue.Message,
         });
     }
     catch
     {
     }
     return(null);
 }