Пример #1
0
        public void Save_feedback()
        {
            FeedbackService service          = new FeedbackService(CreateStubFeedbackRepository(), CreateUserGateway());
            var             feedback         = CreateFeedback();
            var             created_feedback = service.CreateFeedback(feedback.UserId, feedback.AdditionalNotes,
                                                                      feedback.Anonymous, feedback.AllowedForPublishing);

            created_feedback.ShouldBeNull();
        }
Пример #2
0
        public ActionResult Create(FeedbackViewModel feedback)
        {
            Mapper.Initialize(cfg => cfg.CreateMap <FeedbackViewModel, FeedbackDto>());
            var feedbackDto = Mapper.Map <FeedbackViewModel, FeedbackDto>(feedback);

            feedbackDto.OwnerId = User.Identity.GetUserId();
            _feedbackService.CreateFeedback(feedbackDto);
            ModelState.Clear();
            return(View("Index"));
        }
Пример #3
0
 public async Task <ActionResult> Post([FromBody] JObject json) =>
 (await _feedbackService.CreateFeedback(json.ToString(Formatting.None)))
 .MapToAspNetCoreResult();