I am creating a relationship between my classes using code first. The integration happens with MySql, however, after migrating it consider the relationship as one-to-many when I check my workbench ERD.
How can I make a relashionship one-to-one using the classes mentioned below?
Here is my code:
public class About
{
[ForeignKey("User")]
public int Userid { get; set; }
public int id { get; set; }
public string about_file { get; set; }
public string about_desc { get; set; }
public virtual User User { get; set; }
}
public class User
{
[Key]
public int id { get; set; }
public string login { get; set; }
public string password { get; set; }
public virtual About About { get; set; }
public ICollection<Offers> Offers { get; set; } = new List<Offers>();
public ICollection<Portfolio> Portifolios { get; set; } = new List<Portfolio>();
}
Microsoft.EntityFrameworkCore Version: {5.0.7}
