Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(int replyId)
        {
            this.Data = await this.repliesService
                        .GetReplyByIdAsync <ReplyEntityInputModel>(replyId);

            if (this.Data == null)
            {
                return(this.NotFound());
            }

            return(this.Page());
        }
        public async Task <int> DeleteReply(ReplyEntityInputModel inputModel)
        {
            var currentReply = this.repliesRepository.All()
                               .Where(c => c.Id == inputModel.Id)
                               .FirstOrDefault();

            if (currentReply == null)
            {
                return(default(int));
            }

            currentReply.IsDeleted = true;

            var statusCode = await this.repliesRepository.SaveChangesAsync();

            return(statusCode);
        }