예제 #1
0
        public void ListRepository_GetAllItems()
        {
            var items        = _listRepository.FindAll();
            var initialCount = items.Count;
            var testEntity   = GetTestEntity();

            _listRepository.Create(testEntity);
            Assert.IsTrue(_listRepository.FindAll().Count == (initialCount + 1));
            Assert.IsTrue(_listRepository.Delete(testEntity));
            Assert.IsTrue(_listRepository.FindAll().Count == initialCount);
        }
예제 #2
0
        public Task <string> Execute(CreateListCommand command)
        {
            var list = new List {
                Id = Guid.NewGuid().ToString(), Name = command.Name
            };

            return(repo.Create(list));
        }
예제 #3
0
 public async Task <ActionResult <bool> > CreateList([FromBody] ListDTO listDTO)
 {
     return(Ok(await _listRepository.Create(listDTO)));
 }
예제 #4
0
 public void Create(List list)
 {
     _listRepository.Create(list);
 }