Yes, Entity Framework has the similar mappings.
NHibernate:
public PostMap()
{
Map(x => x.Title)
.Length(500)
.Not.Nullable();
}
Entity Framework:
public class YourDomainModelContext : DbContext
{
public YourDomainModelContext() { }
...
public DbSet<Post> Posts { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Post>()
.Property(u => u.Title)
.HasMaxLength(500);
}
}
You can get more information in these blog-posts: