|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
namespace Demo.Models.Domain
{
public partial class Order
{
#region Primitive Properties
public virtual int OrderID
{
get;
set;
}
public virtual Nullable<System.DateTime> OrderDate
{
get;
set;
}
public virtual Nullable<System.DateTime> RequiredDate
{
get;
set;
}
public virtual Nullable<System.DateTime> ShippedDate
{
get;
set;
}
public virtual Nullable<decimal> Freight
{
get;
set;
}
public virtual string ShipName
{
get;
set;
}
public virtual string ShipAddress
{
get;
set;
}
public virtual string ShipCity
{
get;
set;
}
public virtual string ShipRegion
{
get;
set;
}
public virtual string ShipPostalCode
{
get;
set;
}
public virtual string ShipCountry
{
get;
set;
}
#endregion
#region Navigation Properties
public virtual Customer Customer
{
get { return _customer; }
set
{
if (!ReferenceEquals(_customer, value))
{
var previousValue = _customer;
_customer = value;
FixupCustomer(previousValue);
}
}
}
private Customer _customer;
#endregion
#region Association Fixup
private void FixupCustomer(Customer previousValue)
{
if (previousValue != null && previousValue.Orders.Contains(this))
{
previousValue.Orders.Remove(this);
}
if (Customer != null)
{
if (!Customer.Orders.Contains(this))
{
Customer.Orders.Add(this);
}
}
}
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.