예제 #1
0
        public async Task<AddUpdateDriverStatus> UpdateAsync(Driver driver)
        {
            var old = await FindByPlaqueAsync(driver.Plaque);
            if (old?.Id != driver.Id)
                return AddUpdateDriverStatus.DuplicatePlaque;

            return AddUpdateDriverStatus.Success;
        }
예제 #2
0
        public async Task<AddUpdateDriverStatus> AddAsync(Driver driver)
        {
            if (await IsExistByPlaqueAsync(driver.Plaque))
                return AddUpdateDriverStatus.DuplicatePlaque;

            _drivers.Add(driver);
            return AddUpdateDriverStatus.Success;
        }
예제 #3
0
 public void Active(Driver driver)
     => driver.ActiveState = true;
예제 #4
0
 public void Inactive(Driver driver)
     => driver.ActiveState = false;