Sono nuovo a MVC e al framework di entità. Ho cercato molto e ho trovato alcune domande simili (ad esempio Entity Type Has No Key Defined) ma non risolvono il mio problema.non ha una chiave definita - Codice prima
namespace MvcAppInvoice.Models
{
public class Customer
{
public int CustomerID { get; set; }
public string FirstName { get; set; }
public string SurName { get; set; }
public virtual CustomerType Type { get; set; }
}
public class CustomerType
{
public int TypeId { get; set; }
public string TypeName { get; set; }
public virtual ICollection<Customer> customers { get; set; }
}
}
Quando provo ad aggiungere il controller dà il seguente errore:
Ho modificato come suggerito, ma anche lo stesso errore: vedere la modifica nella domanda – DevT
Che dovrebbe avere un errore fisso.Forse dovresti ricostruire la soluzione per farlo funzionare – archil
dopo aver ricostruito i suoi lavori ... grazie ..... :) – DevT