FluentValidation on DateTime

436 Views Asked by At

I have following line of code for Data Annotation validation on PublishedDateTime field, but i would like validate through FluentValidation API

public Instant Published { get; set; }

[Obsolete("EF-serialization purposes")]
[DataType(DataType.DateTime)]         
[EditorBrowsable(EditorBrowsableState.Never)] 
public DateTime PublishedDateTime
{
  get => Published.ToDateTimeUtc();           
  set => Published = DateTime.SpecifyKind(value, DateTimeKind.Utc).ToInstant();
}

How would I convert it to FluentValidation?

0

There are 0 best solutions below