public IActionResult Publish(CommentModel model) { model.AccountId = UserModel.Id; if (model.AccountId == model.QuoteAccountId) { return(Json(false.ToResult("不能引用自己"))); } // 发表评论 var entity = model.MapTo <CommentModel, Comment>(); entity.CreateTime = DateTime.Now; _context.Comment.Add(entity); int affect = _context.SaveChanges(); if (affect > 0) { return(Json(true.ToResult())); } return(Json(false.ToResult())); }
public static Z_Consultant_Comment ToEntity(this CommentModel model, Z_Consultant_Comment destination) { return(model.MapTo(destination)); }
public static Z_Consultant_Comment ToEntity(this CommentModel model) { return(model.MapTo <CommentModel, Z_Consultant_Comment>()); }
public static Comment ToEntity(this CommentModel model, Comment destination) { return(model.MapTo(destination)); }
public static Comment ToEntity(this CommentModel model) { return(model.MapTo <CommentModel, Comment>()); }