public static ResultModel <string> ToMessageModel(this ModelStateDictionary modelState) { if (modelState == null) { throw new ArgumentNullException(nameof(modelState)); } var model = new ResultModel <string>(); modelState.FillDetails(model); return(model); }