Beispiel #1
0
        public async Task Update(TestCreateUpdateDTO test)
        {
            var testUpdate = await _firstContext.Test.FirstAsync(c => c.Id == test.Id);

            testUpdate.Title = test.Title;
            await _firstContext.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task <int> Create(TestCreateUpdateDTO test)
        {
            var testCreate = new Test
            {
                Title = test.Title
            };

            _firstContext.Test.Add(testCreate);
            await _firstContext.SaveChangesAsync();

            return(testCreate.Id);
        }
 public async Task Update([FromBody] TestCreateUpdateDTO dto)
 {
     await _testService.Update(dto);
 }
 public async Task <int> Post([FromBody] TestCreateUpdateDTO dto)
 {
     return(await _testService.Create(dto));
 }