using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LinqSqlEpisodeVProVid
{
    public partial class Product
    {
        partial void OnValidate(System.Data.Linq.ChangeAction action)
        {
            if (this.Discontinued == true && this.UnitsOnOrder > 0)
            {
                throw new ArgumentException("Discontinued can't be false while there are some orders for this product.");
            }
        }
    }
}