I have these classes as my domain models:
public class Ticket
{
public Guid Id { get; set; }
public Guid ParentId { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
public string TicketStatus { get; set; }
public User SenderUserId { get; set; }
public User ReciverrUserId { get; set; }
public DateTime SubmitDate { get; set; }
}
public class User
{
public Guid Id { set; get; }
public DateTime SubmitDate { set; get; }
public string Fullname { set; get; }
public string Permission { set; get; }
public string Role { set; get; }//admin/agent/merchant
public string Password { set; get; }
public string NationalCode { set; get; }
public string Email { set; get; }
public string Telephone { set; get; }
public string Mobile { set; get; }
public string Address { set; get; }
public CountrySection Provience { set; get; }
public CountrySection City { set; get; }
//public Department Department { set; get; }
public CountrySection Town { set; get; }
public ICollection<Merchant> Stores { set; get; }
public ICollection<Invoice> Invoices { set; get; }
public ICollection<Ticket> Tickets { set; get; }
}
When I add migration I get this error:
Unable to determine the relationship represented by navigation 'Ticket.SenderUserId' of type 'User'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'