GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AmerSurkovic/ASP.NET-RESTful-CRUD-API: RESTful CRUD web API in C# using ASP.NET for managing a banner model

BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
BannerFlow
BannerFlow
 
 
Client API tests
Client API tests
 
 
Postman API testing
Postman API testing
 
 
.gitignore
.gitignore
 
 
BannerFlow.sln
BannerFlow.sln
 
 
README.md
README.md
 
 

Repository files navigation

ASP.NET REST API

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.

Packages

  • Controllers

    BannerController

  • Services

    IBannerService

    BannerService

  • Repositories

    IBannerRepository

    BannerRepository

  • Models

    Banner

  • DataTransferObjects

    BannerDTO

  • Validators

    HtmlValidator

API Calls

  • 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 the API

Testing was done using both:

  • Postman

    Used for testing all of the API calls. Provides a better insight to illegal calls and for observing error handling.

  • Developed client

    Also used for testing of the API calls but with focus on proper loading of HTML into the modern web browser.

Postman API Test Results

  • GET ALL /api/banners with an empty database alt text

  • GET ALL /api/banners with a populated database alt text

  • POST BANNER /api/banners : Status code 200 alt text

  • POST BANNER /api/banners : Status code 500 alt text

  • POST BANNER NOT VALID HTML /api/banners : Status code 500 alt text

  • GET BANNER /api/banners/1 : Status code 200 alt text

  • GET BANNER /api/banners : Status code 404 alt text

  • PUT BANNER /api/banners/1 : Status code 200 alt text

  • PUT BANNER /api/banners/1 : Status code 500 alt text

  • DELETE BANNER /api/banners/2 : Status code 200 alt text

  • DELETE BANNER /api/banners/1000 : Status code 500 alt text

  • GET BANNER HTML /api/banners/1/html : Status code 200 alt text

  • GET BANNER HTML /api/banners/1000/html : Status code 404 alt text

Testing with the client

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.

  • Client side overview

    alt text

  • Load HTML 1

    alt text

  • Load HTML 2

    alt text

  • Load HTML 3

    alt text

  • Load HTML 4

    alt text

About

RESTful CRUD web API in C# using ASP.NET for managing a banner model

Topics

asp-netcrud-applicationhtml-rendererhtml-validationpostman-collectionrestful-api

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.