public IActionResult Edit(Guid id)
        {
            var thought = id == Guid.Empty
                ? CreateModel
                : _thoughtService.Get(id).Map <ThoughtEditModel>();

            return(View(EditViewPath, thought));
        }
Example #2
0
        public void ThoughtService_CreateThought_GetContainsIt()
        {
            // arrange
            IThoughtService service = GetServiceInstance();
            ThoughtModel    thought = GetRandomThought();

            // act
            service.Create(thought);

            // assert
            Assert.Equal(service.Get(thought.Id).Id, thought.Id);
        }
        public IActionResult Index([FromRoute] string URI)
        {
            var viewModel = _thoughtService.Get(URI).Map <ThoughtViewModel>();

            return(View(viewModel));
        }