////////////////////////////////////////////////////////////////////////////////////////// // public List <Comment> GetCommentsByLocationID(int id) { List <Comment> Comments = new List <Comment>(); Comment c = null; DataTable dt = null; dt = _locationRepository.GetCommentsByLocationID(id); if (dt != null) { if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { c = new Comment(); c.AddRowElementsToComment(row); Comments.Add(c); } } else { //record that 0 rows were returned. } } return(Comments); }