private void button5_Click(object sender, EventArgs e) { using (var ctx = new OrderITEntities()) { var o = ctx.Orders.First(); var list = ctx.ExecuteFunctionWithComplexProperties <Order>("GetOrdersWithComplexProperties", ctx.Orders, System.Data.Objects.MergeOption.AppendOnly); var x = list.Count(); } }