当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Time difference in MVC Foolproof Validation. ASP.NET MVC

问题描述:

I would like to create a validation for my model:

 [Required]

[DataType(DataType.Time)]

public TimeSpan? time_start { get; set; }

[Required]

[DataType(DataType.Time)]

public TimeSpan? time_end { get; set; }

[Required]

[DataType(DataType.Time)]

public TimeSpan? time_break { get; set; }

if time_end - time_start is greater than 6 hours, then the time_break must be grater than one hour.

this validatino shoud be client and server side.

Is that possible with Foolproof validation.

分享给朋友:
您可能感兴趣的文章:
随机阅读: