I am EF new learner, i have some questions to ask:
1. I don't understand what does virtual mean in for example one to many, i give an example: one question can have many options for e.g.
public class Question
{
public int QuestionId { get; set; }
public string Title { get; set; }
public virtual List<Option> Options { get; set; }
}
public class Option
{
public int OptionId { get; set; }
public string OptionText { get; set; }
public virtual Question Question { get; set; }
}
but what does the "2" virtual mean, because if i delete the virtual
in this line:
public virtual List<Option> Options { get; set; }
, i didn't find any differences, it works well as one to many, so can you explain me very clearly and easily what the 2 virtual
mean, if it's override, override what?
2. I don't know when we should use API fluent, for e.g. the previous one to many ex. without api fluent, it's still a one to many Relationship, so please just tell me when we should use it ? in which occasions for example.
3. in the API fluent, i know "withmany" and "hasmany" together, they mean "many to many", and what's "withrequired? isoptional? "