Sorry about the title, I don't think I could explain it right:
This is a simplified example class, this is working ok. (I also have a Save() method)
public class busItem
{
public Item vItem;
public busItem(int pItem_Id)
{
DBDataContext db = new DBDataContext();
Item vItemQuery = (from i in db.Items
where i.Id == pItem_Id
select i).FirstOrDefault();
vItem = new Item();
vItem.Id = vItemQuery.Id;
vItem.Desc = vItemQuery.Desc;
}
}
And this is my code-behind call:
busItem item = new busItem(1);
item.vItem.Desc = "new description";
the problem is that when I try passing the "new description", i get a "null reference" exception. How can I do that?