views:

37

answers:

0

I extend the Order Class generated by activerecord:

 
public partial class Order
    {
        private string _refCustomer;
        public string RefCustomer {
            get { return _refCustomer; } 
            set{_refCustomer =value;} 
        }
    }

Then, I tried to populate Order's data:



var info = (from o in db.Orders
join c in db.Customers on o.CustomerID equals c.CustomerID
where o.OrderID == id
select new Order
{
    OrderID = o.OrderID,
    OrderDate = o.OrderDate,
    InvoiceDate = o.InvoiceDate,
    DeliveryDate = o.DeliveryDate,
    PaymentReceivedDate = o.PaymentReceivedDate,
    RefCustomer = c.CompanyName
}).SingleOrDefault();

My problem here was the query does not populate the value for the RefCustomer...