Project implements RESTful CRUD web API in C# using ASP.NET for managing a banner model. Data is backed by MongoDB. Method providing the HTML stored in the banner is also implemented.
-
Controllers
-
Services
-
Repositories
-
Models
-
DataTransferObjects
-
Validators
-
GET api/banners
Returns all banners from the database.
-
GET api/banners/{id}
Returns the banner from the database for a specified ID.
-
POST api/banners
Creates a banner record in the database.
-
PUT api/banners/{id}
Updates the banner record in the database for a specified ID with sent update data.
-
DELETE api/banners/{id}
Removes the banner record from the database for a specified ID.
-
GET api/banners/{id}/html
Provides the HTML stored in the banner. Renders correctly in a modern browser - HTML load available in the developed client.
Testing was done using both:
-
Used for testing all of the API calls. Provides a better insight to illegal calls and for observing error handling.
-
Also used for testing of the API calls but with focus on proper loading of HTML into the modern web browser.
Developed client uses all of the CRUD API calls including HTML loading for a given banner. Since the CRUD API calls are tested and presented using Postman they will be not be shown again on the client side. More important aspect is tested through client - and that is correct rendering of HTML when called through the API for the specified bannner.