I have a entity property defined as follows
public virtual string Subject { get; set; }
and its mapped as
this.Property(t => t.Subject)
.IsRequired()
.HasMaxLength(255);
but this does not provide validation for empty strings. Can i specify following constraint using fluent api ?
[Required(AllowEmptyStrings=false)]
public virtual string Subject { get; set; }
No you cannot because fluent-api describes mapping to database whereas the attribute with not allowed empty strings describes validation. Only subset of validation rules can be translated to mapping.