public async Task<AddUpdateDriverStatus> UpdateAsync(Driver driver) { var old = await FindByPlaqueAsync(driver.Plaque); if (old?.Id != driver.Id) return AddUpdateDriverStatus.DuplicatePlaque; return AddUpdateDriverStatus.Success; }
public async Task<AddUpdateDriverStatus> AddAsync(Driver driver) { if (await IsExistByPlaqueAsync(driver.Plaque)) return AddUpdateDriverStatus.DuplicatePlaque; _drivers.Add(driver); return AddUpdateDriverStatus.Success; }
public void Active(Driver driver) => driver.ActiveState = true;
public void Inactive(Driver driver) => driver.ActiveState = false;