public async Task LifeCycle() { var createCmd = new CreateReviewCommand { Review = _review }; createCmd.SetContext(_identity); var msgCode = await ReviewService.CreateReviewAsync(createCmd).ConfigureAwait(false); Assert.IsTrue(msgCode.IsSuccess(), msgCode); var list = await ReviewDAL.GetReviewsAsync(new SyncSoft.StylesDelivered.Query.Review.GetReviewsQuery { }).ConfigureAwait(false); var id = list.Items.OrderByDescending(x => x.CreatedOnUtc).Select(x => x.ID).FirstOrDefault(); var approveCmd = new ApproveReviewCommand { ID = id }; approveCmd.SetContext(_identity); msgCode = await ReviewService.ApproveReviewAsync(approveCmd).ConfigureAwait(false); Assert.IsTrue(msgCode.IsSuccess(), msgCode); var deleteCmd = new DeleteReviewCommand { ID = id }; deleteCmd.SetContext(_identity); msgCode = await ReviewService.DeleteReviewAsync(deleteCmd).ConfigureAwait(false); Assert.IsTrue(msgCode.IsSuccess(), msgCode); }
// ******************************************************************************************************************************* #region - ApproveReview - public async Task <string> ApproveReviewAsync(ApproveReviewCommand cmd) { var dto = await ReviewDAL.GetReviewAsync(cmd.ID).ConfigureAwait(false); if (dto.IsNull()) { return(MsgCodes.ReviewNotExists); } // ^^^^^^^^^^ dto.Status = ReviewStatusEnum.Approved; return(await ReviewDAL.UpdateReviewStatusAsync(dto).ConfigureAwait(false)); }
public Task <string> ApproveReviewAsync(ApproveReviewCommand cmd) => base.RequestAsync(cmd);