문제

In my Model I have things like that :

    [...]

    public string PasswordConfirm { get; set; }

    public string Captcha { get; set; }

    [...]

I would like that these two attributes are required but not serializable

I tried tu use [required] and [nonSerialized] annontations but without success. I already saw this post

But I don't know how to do what I want. It will be helpful for NonObtrusive-Validation, i want these field complete but i don't want to serialized them.

올바른 솔루션이 없습니다

다른 팁

I found a solution to my answer.

I can use the annotation [notMapped] which is compatible with [required], [compare] ...

I also use this :context.Configuration.ValidateOnSaveEnabled = false; where I filled my base because i got a problem with validation here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top