public List<sp_EventRating_DM> ListEventRatings(int? RatingID) { List<sp_EventRating_DM> list = new List<sp_EventRating_DM>(); try { using (VolTeerEntities context = new VolTeerEntities()) { list = (from result in context.sp_EventRating_Select(RatingID,null) select new sp_EventRating_DM { RatingID = result.RatingID, EventID = result.EventID, VolID = result.VolID, RatingValue = result.RatingValue, ActiveFlg = result.ActiveFlg }).ToList(); } // Guaranteed to close the Connection } catch (Exception ex) { throw (ex); } return list; }