コード例 #1
0
 public FundTrackReceiptComment AddComment(int receiptId, string text)
 {
     var newComment = new FundTrackReceiptComment
     {
         Text = text,
         CreatedDate = DateTime.UtcNow
     };
     return _repo.AddComment(receiptId, newComment);
 }
コード例 #2
0
 public ReceiptCommentModel Create(FundTrackReceiptComment model)
 {
     return new ReceiptCommentModel()
     {
         Id = model.Id,
         CreatedDate = model.CreatedDate,
         ReceiptId = model.FundTrackReceipt.Id,
         Text = model.Text,
         UpdateDate = model.UpdateDate
     };
 }
コード例 #3
0
        public FundTrackReceiptComment AddComment(int receiptId, FundTrackReceiptComment comment)
        {
            var receipt = _context.FundTrackReceipts.Find(receiptId);

            if (_context != null)
            {
                receipt.Comments.Add(comment);
                _context.SaveChanges();
                return comment;
            }
            return null;
        }
コード例 #4
0
        public static List<FundTrackReceiptComment> BuildCommentList(int commentSize)
        {
            var commentList = new List<FundTrackReceiptComment>();
            for (int i = 0; i < commentSize; i++)
            {
                var comment = new FundTrackReceiptComment
                {
                    CreatedDate = DateTime.UtcNow,
                    Text = i%3 == 0
                        ? "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."
                        : "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur"
                };

                commentList.Add(comment);
            }
            return commentList;
        }