Beispiel #1
0
        async public Task <bool> InsertVehicle(int id, string name, string abbr)
        {
            var vehicle = new VehicleMake(id, name, abbr);
            var entity  = MapToVehicleMakeEntity(vehicle);
            var result  = await database.SaveVehicleAsync(entity);

            return(result > 0);
        }
Beispiel #2
0
 public async Task <int> UpdateVehicle(VehicleMake vehicleMake)
 {
     return(await database.SaveVehicleAsync(MapToVehicleMakeEntity(vehicleMake)));
 }
Beispiel #3
0
        public async Task <bool> DeleteVehicle(VehicleMake make)
        {
            int number = await database.DeleteVehicleAsync(make.dataBaseId);

            return(number > 0);
        }
Beispiel #4
0
 private VehicleMakeEntity MapToVehicleMakeEntity(VehicleMake vehicle)
 {
     return(App.Mapper.Map <VehicleMake, VehicleMakeEntity>(vehicle));
 }