예제 #1
0
        private Type ResolveCommandType(IParsedMediaType parsedMediaType)
        {
            Type commandType = _settings.ResolveCommandType(parsedMediaType.TypeName, parsedMediaType.Version);

            if (commandType == null)
            {
                throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType);
            }
            return(commandType);
        }
 private Type ResolveCommandType(string mediaType)
 {
     try
     {
         return(_settings.ResolveCommandType(mediaType));
     }
     catch (Exception ex)
     {
         var problemDetails = new HttpProblemDetails
         {
             Status = (int)HttpStatusCode.UnsupportedMediaType,
             Detail = ex.Message
         };
         throw new HttpProblemDetailsException <HttpProblemDetails>(problemDetails);
     }
 }