Ejemplo n.º 1
0
        /// <summary>
        /// Delete method,
        /// deletes a VehicleModel using VehicleModel Repository.
        /// </summary>
        /// <param name="id">VehicleModel Id, type of int.</param>
        /// <returns>Returns boolean to controller, so controller knows if VehicleModel was deleted or not.</returns>
        public async Task <Boolean> DeleteVehicleModelAsync(int id)
        {
            var entity = await repository.GetVehicleModelAsync(id);

            if (entity != null)
            {
                await repository.DeleteVehicleModelAsync(entity);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public async Task <IVehicleModelDTO> GetVehicleModelAsync(Guid id)
 {
     return(await vehicleModelRepository.GetVehicleModelAsync(id));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// READING VEHICLE MODEL
 /// </summary>
 /// <param name="id"></param>
 public async Task <VehicleModel> GetVehicleModelAsync(int id)
 {
     return(AutoMapper.Mapper.Map <VehicleModel>(await _repository.GetVehicleModelAsync(id)));
 }