English 中文(简体)
最新修订命令
原标题:TryUpdateModel updating order

在实施<代码>期间是否有办法控制更新令。 TryUpdateModel? 为了更新其他财产,我需要一个财产有效,但是,由于违约,第二个财产在更新后仍然无效。

What is the default updating order? The weird thing is that the needed property in my code is declared first in both model and form. I can t find any information about this execution order in the Internet.

最佳回答

Is there any way to control updaing order during execution of TryUpdateModel?

没有,任何命令都得不到保障,你永远不能依赖任何命令。 因此,一旦模型完全受约束,而不是在你的观察模式制定者中,你就应当进行验证。

您可使用数据说明属性,或一旦您认识到其局限性(特别是在有条件和比较复杂的验证假设情景方面),即改为。 FluentValidation.NET which

问题回答

尽我所知,受约束者获得这些财产,以便在这些类别中进行分类。 最后,我看到这确实是一种财富,而且这种方法是如何装载的。

然而,由于这是私人执行,这并不取决于这一点。 如果你有这种限制,就建立自己的模拟仲裁人。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签