Hey there! MovieReviewAPI is your go-to platform for managing movie reviews through a simple and powerful API built with ASP.NET MVC Core 6.0. With this API, you can perform various operations on different entities like Categories, Countries, Distributers, Movies, Reviews, and Reviewers.
-
GET
/api/Category
- Retrieve all categories.
-
POST
/api/Category
- Create a new category.
-
GET
/api/Category/{categoryId}
- Retrieve details of a specific category.
-
PUT
/api/Category/{categoryId}
- Update a specific category.
-
DELETE
/api/Category/{categoryId}
- Delete a specific category.
-
GET
/api/Category/movie/{categoryId}
- Retrieve movies associated with a specific category.
-
GET
/api/Country
- Retrieve all countries.
-
POST
/api/Country
- Create a new country.
-
GET
/api/Country/{countryId}
- Retrieve details of a specific country.
-
PUT
/api/Country/{countryId}
- Update a specific country.
-
DELETE
/api/Country/{countryId}
- Delete a specific country.
-
GET
/distributer/{distributerId}
- Retrieve distributors associated with a specific country.
-
GET
/api/Distributer
- Retrieve all distributors.
-
POST
/api/Distributer
- Create a new distributor.
-
GET
/api/Distributer/{distributerId}
- Retrieve details of a specific distributor.
-
PUT
/api/Distributer/{distributerId}
- Update a specific distributor.
-
DELETE
/api/Distributer/{distributerId}
- Delete a specific distributor.
-
GET
/api/Distributer/{distributerId}/movie
- Retrieve movies associated with a specific distributor.
- GET
/api/Movie
- Retrieve all movies.
-
POST
/api/Movie
- Create a new movie.
-
GET
/api/Movie/{movieId}
- Retrieve details of a specific movie.
-
PUT
/api/Movie/{movieId}
- Update a specific movie.
-
DELETE
/api/Movie/{movieId}
- Delete a specific movie.
-
GET
/api/Movie/{movieId}/rating
- Retrieve reviews and ratings for a specific movie.
-
GET
/api/Review
- Retrieve all reviews.
-
POST
/api/Review
- Create a new review.
-
GET
/api/Review/{reviewId}
- Retrieve details of a specific review.
-
PUT
/api/Review/{reviewId}
- Update a specific review.
-
DELETE
/api/Review/{reviewId}
- Delete a specific review.
-
GET
/api/Review/movie/{movieId}
- Retrieve reviews for a specific movie.
-
GET
/api/Reviewer
- Retrieve all reviewers.
-
POST
/api/Reviewer
- Create a new reviewer.
-
GET
/api/Reviewer/{reviewerId}
- Retrieve details of a specific reviewer.
-
PUT
/api/Reviewer/{reviewerId}
- Update a specific reviewer.
-
DELETE
/api/Reviewer/{reviewerId}
- Delete a specific reviewer.
-
GET
/api/Reviewer/{reviewerId}/reviews
- Retrieve reviews submitted by a specific reviewer.
-
CategoryController.cs
- Takes care of everything related to movie categories.
-
CountryController.cs
- Handles operations concerning countries.
-
DistributorController.cs
- The go-to place for distributor-related operations.
-
MovieController.cs
- Your go-to for all things movie-related.
-
ReviewController.cs
- The maestro behind movie review operations.
-
ReviewerController.cs
- Manages operations related to reviewers.
- DataContext.cs
- This is the database maestro, juggling all the data.
- Houses DbSet properties for categories, countries, distributors, movies, movie categories, reviews, and reviewers.
- Defines some fancy relationships between entities in the
OnModelCreating
method.
- These are like the messengers, ensuring smooth communication between entities and the outside world.
- CategoryDto.cs
- CountryDto.cs
- DistributorDto.cs
- MovieDto.cs
- ReviewDto.cs
- ReviewerDto.cs
- Uses AutoMapper to create maps between entities and DTOs. It's like the translator making sure everyone speaks the same language.
-
ICategoryRepository.cs
-
ICountryRepository.cs
-
IDistributorRepository.cs
-
IMoviesRepository.cs
-
IReviewRepository.cs
-
IReviewerRepository.cs
- These are the rulebooks for data access. Everyone follows their lead.
- These are the main characters, representing what's happening behind the scenes in the database.
- Category.cs
- Country.cs
- Distributor.cs
- Movie.cs
- MovieCategory.cs
- Review.cs
- Reviewer.cs
- The task force implementing all the data access strategies.
- CategoryRepository.cs
- CountryRepository.cs
- DistributorRepository.cs
- MoviesRepository.cs
- ReviewRepository.cs
- ReviewerRepository.cs
- Configures all the services like controllers, repositories, AutoMapper, and DbContext.
- Sets up Swagger to make sure everyone knows what's going on.
- Defines where the database lives using Entity Framework.
Want to kickstart the party with some seed data? Just run the application with the "seeddata" argument, and you're good to go!
- Configures Swagger for some snazzy API documentation when you're in development mode.
Feel free to customize and add your own flavor to the API. It's here to make your movie review adventures even more awesome! ๐ฟ๐ฌ๐
I use xUnit, FakeItEasy and Fluent Assertions.
-
xUnit: A testing framework that keeps things simple and snappy. ๐ฆ
-
FakeItEasy: Our backstage pass to mocking โ perfect for faking it 'til you make it! ๐ญ
-
Fluent Assertions: Making assertions a breeze with a touch of flair. Fluent and fabulous! ๐ฌ
MovieController: [Passed!]!
- GetMovies() Passed!
- CreateMovies() Passed!
- GetMovie() Passed!
- GetMovieRaiting() Passed!
- UpdateMovie() Passed!
- DeleteMovie() Passed!
CategoryController: [Passed!]!
- GetCategories() Passed!
- GetCategory() Passed!
- GetMovieByCategoryId() Passed!
- CreateCategory() Passed!
- UpdateCategory() Passed!
- DeleteCategory() Passed!
CountryController: [Passed]!
- GetCountries() Passed!
- GetCountry() Passed!
- GetCountryOfAnDistributer() Passed!
- CreateCountry() Passed!
- UpdateCountry() Passed!
- DeleteCountry() Passed!
DistributerController: [Passed]!
- GetDistributers() Passed!
- GetDistributer() Passed!
- GetMovieByDistributerId() Passed!
- CreateDistributer() Passed!
- UpdateDistributer() Passed!
- DeleteDistributer() Passed!
ReviewController: [Passed]!
- GetReviews() Passed!
- GetReview() Passed!
- GetReviewsForAMovie() Passed!
- CreateReview() Passed!
- UpdateReview() Passed!
- DeleteReview() Passed!
ReviewerController: [Passed]!
- GetReviewers() Passed!
- GetReviewer() Passed!
- GetReviewsByAReviewer() Passed!
- CreateReviewer() Passed!
- UpdateReviewer() Passed!
- DeleteReviewer() Passed!
MoviesRepositroy: [Passed!]
- GetMovie(title) Passed!
- GetMovie(Id) Passed!
- GetMovieRaiting() Passed!
- GetMovies() Passed!
- MovieExists() Passed!
- UpdateMovie() Passed!
CategoryRepository: [Passed!]
- CategoryExists() Passed!
- CreateCategory() Passed!
- GetCategories() Passed!
- GetCategory() Passed!