public IActionResult Create([FromBody] Theme theme)
        {
            int success = _themeRepo.Create(theme);

            if (success == 0)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Пример #2
0
        public void Should_save_new_theme()
        {
            var newTheme = ThemeFactory.Theme(Guid.NewGuid(), "Name 3", "Description 3", "Folder 3");

            using (var context = new WeapsyDbContext(_contextOptions))
            {
                var repository = new ThemeRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper());
                repository.Create(newTheme);
            }

            using (var context = new WeapsyDbContext(_contextOptions))
            {
                var repository = new ThemeRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper());
                var theme      = repository.GetById(newTheme.Id);

                Assert.NotNull(theme);
            }
        }
Пример #3
0
 public void Create(Theme obj)
 {
     _themeRepository.Create(obj);
 }