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

            return(View(EditViewPath, thought));
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public IActionResult Index([FromRoute] string URI)
        {
            var viewModel = _thoughtService.Get(URI).Map <ThoughtViewModel>();

            return(View(viewModel));
        }