Wednesday, 1 February 2017

MVC - fix error - The associated metadata type for type contains the following unknown properties or fields:


Watch solution on YouTube


Entire error message:
Additional information: The associated metadata type for type 'MVC_Intra.Models.Customer' contains the following unknown properties or fields: Address. Please make sure that the names of these members match the names of the properties on the main type.

Ensure your Metadata class doesn't  have extra (or deleted) properties

using System.ComponentModel.DataAnnotations;
namespace MVC_Intra.Models
{
    [MetadataType(typeof(CustomersMetadata))]
    public partial class Customer { }
    public class CustomersMetadata
    {
        public int ID { get; set; }
        public string FisrtName { get; set; }
        public string LastName { get; set; }

   
    }





No comments:

Post a Comment