I am working on an Online shopping project. I used JWT for authentication. My User.cs class is:
namespace Core.Entities.Concrete
{
public class User: IEntity
{
public int ID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public byte[] PasswordHash { get; set; }
public byte[] PasswordSalt { get; set; }
public bool Status { get; set; }
/// <summary>
/// A person can have multiple Orders
/// </summary>
public virtual ICollection<Order> Orders { get; set; } //*Could not be found Error*
public User() => Orders = new List<Order>(); //*Could not be found Error*
}
}
I want to add Orders feature to my User class, a customer can order products. But Usre.cs class is in Core layer which hasn't dependency to Entities layer(Order class inside) How can I solve this issue?
I shouldn't give Core layer reference to Entities Layer.
