Exemplo n.º 1
0
        public async Task <ResultModel> SearchVehicles(Vehicle vehicle, int PageSize = 10, int PageNo = 1)
        {
            try
            {
                var data = await _vehicleRepository.GetSearchVehiclesAsync(PageSize, PageNo, vehicle);

                return(ResponceModel.GetResponse(data));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }
Exemplo n.º 2
0
        public async Task <ResultModel> GetVehicles()
        {
            try
            {
                var data = await _vehicleRepository.GetVehiclesAsync();

                return(ResponceModel.GetResponse(data));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }