Trying to set the title attribute of an html element as the parameter passed to the entity.Property().HasComment(comment) method.

I've tried with no luck:

<label asp-for="OrganizationTypeId" title="@ViewData.ModelMetadata.Description">

The value is null while the OnModelCreating method is setting the following:

modelBuilder.Entity<Organization>(entity =>
{
   entity.Property(e => e.OrganizationTypeId).HasComment("Foreign key of the Org...");

Is this comment available to be used as an html attribute?

Thanks

1

There are 1 answers

1
Leo On BEST ANSWER

This DbContext extension method shows how to retrieve comments for a model.