如何保存无效数据?

How to save invalid data?

We need to create a program that collects runsheets and other form data.

All the forms need to be saved as they're typed, unless explicitly discarded, even the form field data is invalid.
The user should always be able to 'Save for later', or just shut off his window, and data should be saved.

The problem is I'm gonna have to have all the runsheets indexed and searchable, including the invalid ones.

I'm looking at few options:

My real doubt is:

I think I'll go for this option, because having to search two tables bothers me more, and also because indeed the columns won't be so strict, but I can still set their MaxLength and some other vital properties that are vital for the database structure but do not really disturb the validation process.
Really it's not that I'll have to store a datetime as a string or going that low.

I just wanted to hear from people who faced a similar situation and might have some smooth magical method...

如何将它们全部保存为用户浏览器中的字符串形式的 cookie(字符串不需要在客户端进行验证,除非您将其绑定到)。只需为您的数据库提交使用服务器验证。

在此处查看有关将数据保存到 cookie 中的更多信息:

Storing multiple values in cookies

如我所说在您的模型中不使用客户端验证。

为此,只需使用 ViewModel 并将 ViewModel 保存在 Cookie 中。然后在您的控制器上,当用户想要最终保存到数据库中时验证它们。

我想我只是要在模型中进行非常无干扰的验证(即 MaxLength 等),以及一个 属性 来确定是否应该在没有验证的情况下保存模型,然后实现 IValidatableObject 我将实现所有必需的验证属性作为自定义自定义验证。