Aspnetcore: ModelMetadataType not work with Blazor

Created on 27 Jun 2020  路  2Comments  路  Source: dotnet/aspnetcore

I have a project include two project in same Solution Explorer

  • First: DbModelContextProvider (Class library)
  • Second: AppApiProvider (MVC core api -v3.1.4)

In DbModelContextProvider project i want create Metadata validation for Department

public class DepartmentMetaData
{
        [Display(Name = "Department Name")]
        [Required]
        public string Name { get; set; }
}

Then create new class _Department_ but partial class

[MetadataType( typeof(DepartmentMetaData))]
 public partial class Department
{
}

Same code use with MVC core web app work success but when i want work with Blazor not work

Answered Resolved area-blazor question

All 2 comments

@zanyar3 thanks for contacting us.

That is an ASP.NET Core feature, not something that Blazor supports.

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

Was this page helpful?
0 / 5 - 0 ratings