public bool CreateComment(T_Comment comment, long idUser, long idBug) { using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities ()) { comment.T_User.id = idUser; comment.T_Bug.id = idBug; bugtrack.AddToT_Comment(comment); bugtrack.SaveChanges(); return true; } }
public bool UpdateComment(T_Comment comment) { using (BugTrackLikeEntities bugtrack = new BugTrackLikeEntities()) { T_Comment com = bugtrack.T_Comment.Where(c => c.id == comment.id).FirstOrDefault(); if (com != null) { com = comment; } bugtrack.SaveChanges(); return true; } }
/// <summary> /// Create a new T_Comment object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="details">Initial value of the details property.</param> public static T_Comment CreateT_Comment(global::System.Int64 id, global::System.String details) { T_Comment t_Comment = new T_Comment(); t_Comment.id = id; t_Comment.details = details; return t_Comment; }
/// <summary> /// Deprecated Method for adding a new object to the T_Comment EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToT_Comment(T_Comment t_Comment) { base.AddObject("T_Comment", t_Comment); }