Advertisement
Guest User

Untitled

a guest
Sep 11th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. using System;
  2. using Manifesto.Models.InputModels;
  3. using Microsoft.AspNetCore.Mvc;
  4.  
  5. namespace Manifesto.WebApi
  6. {
  7. [Route("api/rentals")]
  8. public class BookController
  9. {
  10. [HttpGet]
  11. [Route("")]
  12. // CHANGE TO IActionResult
  13. public void GetAllRentals([FromQuery] string category)
  14. {
  15. //
  16. return;
  17. }
  18.  
  19. [HttpGet]
  20. [Route("{id:int}")]
  21. public void GetBookById(int id)
  22. {
  23. return;
  24. }
  25.  
  26. [HttpPost]
  27. [Route("")]
  28. public void CreateBook([FromBody] BookInputModel book)
  29. {
  30. if (book == null)
  31. {
  32. throw new ArgumentNullException(nameof(book));
  33. }
  34. return;
  35. }
  36.  
  37. [HttpPut]
  38. [Route("{id:int}")]
  39. public void UpdateBookById(int id)
  40. {
  41. return;
  42. }
  43.  
  44. [HttpDelete]
  45. [Route("{id:int}")]
  46. public void DeleteRentalById(int id)
  47. {
  48. return;
  49. }
  50.  
  51.  
  52.  
  53.  
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement