示例#1
0
 public IActionResult Post([FromBody] JobReviewDto dto,
                           [FromServices] ICreateJobReviewCommand command)
 {
     dto.UserId = _actor.Id;
     executor.ExecuteCommand(command, dto);
     return(Ok(new { StatusCode = HttpStatusCode.OK, Message = "New Job Review Created" }));
 }
        public void Execute(JobReviewDto request)
        {
            _validator.ValidateAndThrow(request); //ValidationException
            var jobReview = new JobReviews()
            {
                Description = request.Description,
                JobId       = request.JobId,
                UserId      = request.UserId
            };

            _context.Entry(jobReview).State = EntityState.Added;
            _context.SaveChanges();
        }