Giter Club home page Giter Club logo

csharp-api-cinema-challenge's Introduction

Cinema Booking API Challenge

Learning Objectives

  • Use ASP.NET and Entity Framework to build a RESTful API
  • Use object-oriented programming to manage source code complexity
  • Use an API client (Postman, Insomnia, etc.) to test-drive code

Instructions

It's time to use everything you've learned up to this point! Your task is to build a complete API in C# using ASP.NET and Entity Framework. Treat this challenge like a real project, not just an exercise to complete. Take time to read documentation, experiment & discuss ideas with your peers and teachers.

  1. Fork this repository
  2. Clone your fork to your machine
  3. Open the api-cinema-challenge solution with Visual Studio
  4. Create appsettings.json with your own db credentials. Note that the Data folder already contains a CinemaContext which you may use to add your DbSets.
  5. Create a complete ERD to describe the model of your data and the relationships between each entity
  6. Check the Program.cs and make any changes needed before starting.
  7. Separate out your code in the Data context with seeders, Models, Repository layer, Endpoints layer (controllers).
  8. Finally your task is to develop the API that satisfies this API spec

Pay close attention to the details of each endpoint. How you choose to implement the solution is up to you, there are no wrong answers, but the inputs and outputs must match the provided API documentation exactly.

Extensions

Here is an extension API spec.

It contains a few new routes, different approaches to data mutation and, most importantly, an entirely different response format for each request.

Bonus

  • When creating and entity that contains a reference to another entity, if that other entity does not exist then create that other entity if the data is correct.

Tips

  • Beware of cyclical Json and Db Entities reference
    • Use decorators to ignore model values to json ignore
    • You could create different Data Transfer Objects to avoid those dependencies Entity with cyclical dependance:
{
  "id": 0,
  "name": "string",
  "otherEntity": {
    "id": 0,
    "entity": { // <------- Root entity is repeated here, resulting for child entity being repeated and goes on and on.
        "id": 0,
        "otherEntity" {
            ...The whole structure repeats infinitely...
        }
    }
  }
}

Current:

  • Create the ERD
  • Create models
  • Create Controllers with routes to satisfy the API
  • Create Relationships between the components as shown in the ERD

Useful Resources

You'll need to do a fair amount of research in order to complete this challenge. Make liberal use of StackOverflow, search engines, YouTube and the teaching team.

Here are some reference documentation links that will be useful:

csharp-api-cinema-challenge's People

Contributors

logi13 avatar uerbzr avatar dogezen avatar stiannordvik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.