private static ModelStateDictionary GetModelStateFromHttpError(HttpError error) { if (error == null) { return(null); } return(GetModelStateFromDictionary(error.ToDictionary(x => x.Key, x => x.Value as string[]))); }