GithubHelp home page GithubHelp logo

tvshows's Introduction

TV Shows Application

This is a sample solution for a TV Shows application that allows users to interact with a list of TV shows, mark shows as favorites, and view the list of favorite shows.

###Solution Structure

The solution consists of several projects organized as follows:

  • TVShows.Application: Contains the application logic, including MediatR handlers and other service classes.
  • TVShows.Domain: Contains domain classes and repository interfaces.
  • TVShows.Infrastructure: Implements the application infrastructure, including repositories and any other data access logic.
  • TVShows.-Console: Project that exposes access points for clients to interact with the application.
  • TVShows.Tests: Contains unit tests for different components of the application

###Dependencies

The solution uses the following main dependencies:

  • .NET 6 SDK: .
  • MediatR: Used to implement the Command-Query Responsibility Segregation (CQRS) pattern and manage interactions between controllers and handlers.
  • **Entity Framework Core: **Used for database access and entity-to-table mapping.
  • NUnit and JustMock: Used for unit testing.

###Database Configuration

The application uses a local SQL Server database to store TV show data and user favorites. To set up the local database, follow these steps:

  1. Make sure you have SQL Server installed on your machine or have access to a SQL Server instance.

  2. Open the appSettings.json file of the TVShows.Infrastructure project.

  3. In the DefaultConnection section, update the ConnectionString with the correct information for your SQL Server instance. For example:

     "ConnectionStrings": {
     	"DefaultConnection": "Data Source={Host};Initial Catalog={DatabaseName};Integrated Security=True;TrustServerCertificate=True
     }
    
  • Once the connection string is updated, you can proceed with running the migration command-line.

###Running Migration To create the database and apply the migrations, you can use the Entity Framework Core command-line tools. Here is how to do it:

  1. Open a command prompt or terminal.

  2. Change the working directory to the TVShows.Infrastructure project folder:

     cd path/to/TVShows.Infrastructure
    
  3. Run the migration command:

     dotnet ef database update
    

This will apply the pending migrations and create the TVShows database on your SQL Server instance.

###Running the Application

To run the application, follow these steps:

  1. Open the solution in Visual Studio or your preferred IDE.

  2. Set the TVShows.Console project as the startup project.

  3. Press F5 or click the "Start" button to run the application. Or by command line:

     cd path/to/TVShows.Console
    

then: dotnet run

###Unit Testing

The TVShows.Tests project contains unit tests for different functionalities of the application. The tests are written using the NUnit testing framework, and JustMock are used to simulate external dependencies.

To run the tests, simply go to the root folder in your terminal.

	cd ..

then:

	dotnet run test

Or click "Run Tests" in your IDE.

tvshows's People

Contributors

ricardodelcid12 avatar

Watchers

 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.