I'm working on generating code (models) from my database. I'm not sure how to, if possible, setup my database to create a relationship including cardinality. Is this something that can be done, or am I stuck with simply generating models that match a table without relationships or cardinality because I did a data-first design?
Oh, and in case I'm using the incorrect term, cardinality is the type of relationship (one-to-one, one-to-many, many-to-many). That way my models will generate with a reference to another model, or to an ICollection<T>
of models.
For example:
public class OrderInformation
{
public virtual int OrderId { get; set; }
public virtual DateTime OrderDate { get; set; }
public virtual BillingInformation BillingInfo { get; set; }
public virtual Address DeliveryAddress { get; set; }
public virtual ICollection<ItemInformation> ShoppingCart { get; set; }
}