protected async Task UpdateBusCompany(CreateOrUpdateBusCompanyInput input)
        {
            var entity = await _repository.GetAsync(input.BusCompany.Id.Value);

            ObjectMapper.Map(input.BusCompany, entity);
            //var updateEntity = ObjectMapper.Map<BusCompany>(input.BusCompany);
            await _repository.UpdateAsync(entity);

            //await CurrentUnitOfWork.SaveChangesAsync(); //It's done to get Id of the edition.
            //throw new NotImplementedException();
        }
 public async Task CreateOrUpdateBusCompany(CreateOrUpdateBusCompanyInput input)
 {
     if (input.BusCompany.Id.HasValue)
     {
         await UpdateBusCompany(input);
     }
     else
     {
         await CreateBusCompany(input);
     }
 }
 protected async Task CreateBusCompany(CreateOrUpdateBusCompanyInput input)
 {
     var entity = ObjectMapper.Map <BusCompany>(input.BusCompany);
     await _repository.InsertAndGetIdAsync(entity);
 }