SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Threading.Tasks;
  2. using System.Web.Http;
  3. using MaranelloClassicParts.Admin.Dto.DeliverySizes.Requests;
  4. using MaranelloClassicParts.Admin.Dto.DeliverySizes.Responses;
  5. using MaranelloClassicParts.Admin.Requests.DeliverySizes;
  6. using MaranelloClassicParts.Common.Mappings.Abstractions;
  7. using MaranelloClassicParts.DomainModel.Models;
  8. using MaranelloClassicParts.Services.Abstractions.Providers;
  9.  
  10. namespace MaranelloClassicParts.Admin.Controllers.API
  11. {
  12.     public abstract class BaseController: TestApiController<int, DeliverySizeResponse, DeliverySizesFilter, DeliverySizeCreateRequest>
  13.     {
  14.         private readonly IDeliverySizesProvider _deliverySizesProvider;
  15.         private readonly IMapper _mapper;
  16.  
  17.         protected BaseController(IDeliverySizesProvider deliverySizesProvider,
  18.                                  IMapper mapper)
  19.  
  20.         {
  21.             _deliverySizesProvider = deliverySizesProvider;
  22.             _mapper = mapper;
  23.         }
  24.  
  25.         [HttpGet]
  26.         [Route("{id}")]
  27.         public async Task<DeliverySizeResponse> GetById(int id)
  28.         {
  29.             var item = await _deliverySizesProvider.GetByIdAsync(id);
  30.             var result = _mapper.Map<DeliverySize, DeliverySizeResponse>(item);
  31.  
  32.             return result;
  33.         }
  34.     }
  35.  
  36.     public abstract class TestApiController<TEntity, TIndexModel, TIndexFilter, TCreateModel>
  37.     {
  38.         public virtual Task<TIndexModel> GetByID(TEntity id)
  39.         {
  40.            
  41.         }
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top