私もthis answerに報告したように、MVC 4の "部分検証技術" を実装する必要があるでしょう:MVC 4:「部分検証」テクニックの使い方は?
public class DontValidateEmailAttribute : ActionFilterAttribute
{ public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var modelState = filterContext.Controller.ViewData.ModelState;
var incomingValues = filterContext.Controller.ValueProvider;
var key = modelState.Keys.Single(x => incomingValues.Equals("Email"));
modelState[key].Errors.Clear();
}
}
しかし、私は、次のコンパイルエラー取得: "'System.Collections.Generic.ICollection<string>' does not contain a definition for 'Single' and no extension method 'Single' accepting a first argument of type 'System.Collections.Generic.ICollection<string>' could be found (are you missing a using directive or an assembly reference?)
を..."
THX
「System.Linqを使用しています」というメッセージが表示されていませんか? – gideon
ありがとうございました!出来た。あなたが答えを出す場合、私は喜んで有効な回答としてマークします。 – Larry