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

            if (success == 0)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 3
0
 public void Create(Theme obj)
 {
     _themeRepository.Create(obj);
 }