public List <DiscussionDetail> GetComments(int discussionId) { using (TransactionScope trans = new TransactionScope()) { try { using (gulam786_HurufEntities _db = new gulam786_HurufEntities()) { var discussions = (from d in _db.DiscussionComments join u in _db.UserRegisters on d.CommentBy equals u.RegistrationID where d.DiscusssionID == discussionId select new DiscussionDetail { DiscusssionID = d.DiscusssionID, Description = d.Comment, PostedDate = d.CommentDate, FileName = u.FileName, FullName = u.FirstName + " " + u.LastName }).ToList(); trans.Complete(); return(discussions); } } catch (Exception ex) { trans.Dispose(); throw ex; } finally { trans.Dispose(); } } }
public RepsistoryEF(bool DisableLazyLoading) { _db = new gulam786_HurufEntities(); _db.Configuration.LazyLoadingEnabled = DisableLazyLoading; }
public RepsistoryEF() { _db = new gulam786_HurufEntities(); }