public DashboardItem RetreiveDashboardItem(string id) { int itemID = Convert.ToInt32(id); StoredProcedureDataContext dbml = new StoredProcedureDataContext(); var result = dbml.RetreiveDashboardItem(itemID).ToList(); var i = result.FirstOrDefault(); DateTime startdatestring = i.StartDate; DateTime endDatestring = i.EndDate; DashboardItem item = new DashboardItem { ItemID = i.ItemID, DashboardID = i.DashboardID, ItemName = i.ItemName, EndDate = endDatestring, StartDate = startdatestring, StatusID = i.StatusID, WorkingTeams = RetreiveTeamsWorkingOnItem(itemID), Sources = GetSourcesByItemID(itemID) }; return(item); }