示例#1
0
        public async Task CreateAsync(CatDto input)
        {
            if (!catDtos.Any(a => a.ID == input.ID))
            {
                catDtos.Add(input);
            }

            await Task.CompletedTask;
        }
示例#2
0
        public async Task UpdateAsync(CatDto input)
        {
            var catDto = catDtos.Find(a => a.ID == input.ID);

            if (catDto == null)
            {
                throw new EntityNotFoundException(typeof(CatDto));
            }

            catDto.Name = input.Name;

            await Task.CompletedTask;
        }