public async Task ChangeProposeCount() { int countFields = await countProposeRepository.CountAsync(); if (countFields == 0) { CountPropose c = new CountPropose(); c.Count = 1; await countProposeRepository.Create(c); } CountPropose countPropose = await countProposeRepository.Get().FirstOrDefaultAsync(); countPropose.Count = countPropose.Count + 1; await countProposeRepository.Update(countPropose); }
public async ValueTask <int> GetCount() { CountPropose c = await countProposeRepository.Get().FirstOrDefaultAsync(); return(c.Count); }