I am working through a tutorial 'Professional ASP.NET MVC 3' by J Galloway. In this tutorial, Jon shows us how to build the MVC music store.
I am at the part where we are creating CS classes to model the data using EF code first.
I all the examples in the book, public virtual int property {get; set; }
is used with no explanation. The term virtual is stuffed EVERYWHERE.
Elsewhere on the web, I have not seen the term virtual used with any kind of concistency whatsoever.
Could anybody explain to me:
- The purpose of the term 'virtual' in this particular context
- Is using 'virtual' necessary?
- Why do some people use 'virtual' and others do not?
- Why do some people only use 'virtual' when defining foreign keys?
- What is the best practice use of the term 'virtual'?
Many thanks in advance