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(); }
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")); }
public async Task <ActionResult> Post([FromBody] JObject json) => (await _feedbackService.CreateFeedback(json.ToString(Formatting.None))) .MapToAspNetCoreResult();