/// <summary> /// Return a list of Sample addresses using LINQ to SQL /// </summary> /// <returns></returns> public List<sp_Sample_Address_Select_DM> ListSampleAddress() { List<sp_Sample_Address_Select_DM> list = new List<sp_Sample_Address_Select_DM>(); try { using (VolTeerEntities context = new VolTeerEntities()) { list = (from result in context.sp_Sample_Address_Select() select new sp_Sample_Address_Select_DM { AddrID = result.AddrID, ActiveFlg = result.ActiveFlg, AddrLine1 = result.AddrLine1, AddrLine2 = result.AddrLine2, AddrLine3 = result.AddrLine3, City = result.City, St = result.St, Zip = result.Zip, Zip4 = result.Zip4 }).ToList(); } // Guaranteed to close the Connection } catch (Exception ex) { throw (ex); } return list; }