forked from stphnwlsh/CleanMinimalApi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endpoint Validation Update to Factory (stphnwlsh#28)
* Update Endpoint Validation to use a factory * Inspiration from [Minimal API validation with ASP.NET 7.0 Endpoint Filters](https://benfoster.io/blog/minimal-api-validation-endpoint-filters/) * Reduce application models to minimal records * Remove the Entity model from the application models * Removed DateCreated and DateModified from Application models * Test Cleanup and Reduce Coverage Threshold * Code Formatting
- Loading branch information
Showing
50 changed files
with
409 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ coverage: | |
project: | ||
default: | ||
target: 100% | ||
threshold: 3% | ||
threshold: 2% |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
namespace CleanMinimalApi.Application.Authors.Entities; | ||
|
||
using Application.Common.Entities; | ||
using Application.Reviews.Entities; | ||
|
||
public record Author : Entity | ||
{ | ||
public string FirstName { get; set; } | ||
|
||
public string LastName { get; set; } | ||
|
||
public ICollection<Review> Reviews { get; set; } | ||
} | ||
public record Author(Guid Id, string FirstName, string LastName, ICollection<Review> Reviews = null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
namespace CleanMinimalApi.Application.Authors.Entities; | ||
|
||
using Application.Common.Entities; | ||
|
||
public record ReviewAuthor : Entity | ||
{ | ||
public string FirstName { get; set; } | ||
|
||
public string LastName { get; set; } | ||
} | ||
public record ReviewAuthor(Guid Id, string FirstName, string LastName); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
namespace CleanMinimalApi.Application.Movies.Entities; | ||
|
||
using Application.Common.Entities; | ||
using Application.Reviews.Entities; | ||
|
||
public record Movie : Entity | ||
{ | ||
public string Title { get; init; } | ||
|
||
public ICollection<Review> Reviews { get; init; } | ||
} | ||
public record Movie(Guid Id, string Title, ICollection<Review> Reviews = null); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace CleanMinimalApi.Application.Movies.Entities; | ||
|
||
public record ReviewedMovie(Guid Id, string Title); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
namespace CleanMinimalApi.Application.Reviews.Entities; | ||
|
||
using Application.Authors.Entities; | ||
using Application.Common.Entities; | ||
using Application.Movies.Entities; | ||
|
||
public record Review : Entity | ||
{ | ||
public int Stars { get; init; } | ||
|
||
public ReviewMovie ReviewedMovie { get; init; } | ||
|
||
public ReviewAuthor ReviewAuthor { get; init; } | ||
} | ||
public record Review( | ||
Guid Id, | ||
int Stars, | ||
ReviewedMovie ReviewedMovie = null, | ||
ReviewAuthor ReviewAuthor = null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/Infrastructure/Databases/MoviesReviews/Mapping/EntitiyMappingProfile.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
namespace CleanMinimalApi.Infrastructure.Databases.MoviesReviews.Models; | ||
|
||
using System.ComponentModel.DataAnnotations.Schema; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[ExcludeFromCodeCoverage] | ||
internal record Author : Entity | ||
{ | ||
public string FirstName { get; init; } | ||
|
||
public string LastName { get; init; } | ||
|
||
[InverseProperty("ReviewAuthor")] | ||
public ICollection<Review> Reviews { get; init; } | ||
} |
Oops, something went wrong.