public static Respuesta Comment(int problemId, String comment) { var modx = new ModelDataContext(); string name = Membership.GetUser().UserName; Guid userId = (Guid)(Membership.GetUser().ProviderUserKey); var newComment = new Comment() { Commentary = comment, IdProblem = problemId, IdUser = userId, NameUser = name }; modx.Comments.InsertOnSubmit(newComment); modx.SubmitChanges(); return new Respuesta() { Estado = true, Mensaje= "Comment added succesfuly"}; }
partial void DeleteComment(Comment instance);
partial void UpdateComment(Comment instance);
partial void InsertComment(Comment instance);
private void detach_Comments(Comment entity) { this.SendPropertyChanging(); entity.Problem = null; }
private void attach_Comments(Comment entity) { this.SendPropertyChanging(); entity.Problem = this; }