diff --git a/FastEndpoints.TemplatePack.csproj b/FastEndpoints.TemplatePack.csproj
index e2993f6..8cc8fba 100644
--- a/FastEndpoints.TemplatePack.csproj
+++ b/FastEndpoints.TemplatePack.csproj
@@ -2,7 +2,7 @@
- 1.7.1
+ 1.7.2
Template
FastEndpoints.TemplatePack
diff --git a/changelog.md b/changelog.md
index a9693e8..570180d 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,2 +1,2 @@
- upgrade dependencies to latest
-- remove `Xunit.Priority` package
\ No newline at end of file
+- add reflection source generator to startup config
\ No newline at end of file
diff --git a/templates/integrated/Source/Features/Members/SignUp/Request.cs b/templates/integrated/Source/Features/Members/SignUp/Request.cs
index 498dffa..2926ec4 100644
--- a/templates/integrated/Source/Features/Members/SignUp/Request.cs
+++ b/templates/integrated/Source/Features/Members/SignUp/Request.cs
@@ -6,22 +6,22 @@ sealed class Request
{
//request dto shape is dictated by front-end team
- public User UserDetails { get; init; }
- public string Email { get; init; }
- public string BirthDay { get; init; }
- public string Gender { get; init; }
- public ContactDetails Contact { get; init; }
- public AddressDetails Address { get; init; }
+ public User UserDetails { get; set; }
+ public string Email { get; set; }
+ public string BirthDay { get; set; }
+ public string Gender { get; set; }
+ public ContactDetails Contact { get; set; }
+ public AddressDetails Address { get; set; }
public sealed class User
{
- public string FirstName { get; init; }
- public string LastName { get; init; }
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
}
public sealed class ContactDetails
{
- public string MobileNumber { get; init; }
+ public string MobileNumber { get; set; }
public bool Whatsapp { get; set; }
public bool Viber { get; set; }
public bool Telegram { get; set; }
@@ -29,10 +29,10 @@ public sealed class ContactDetails
public sealed class AddressDetails
{
- public string Street { get; init; }
- public string City { get; init; }
- public string State { get; init; }
- public string ZipCode { get; init; }
+ public string Street { get; set; }
+ public string City { get; set; }
+ public string State { get; set; }
+ public string ZipCode { get; set; }
}
internal sealed class Validator : Validator
diff --git a/templates/integrated/Source/MyProject.csproj b/templates/integrated/Source/MyProject.csproj
index c19d7a6..3a4740a 100644
--- a/templates/integrated/Source/MyProject.csproj
+++ b/templates/integrated/Source/MyProject.csproj
@@ -10,15 +10,15 @@
-
+
-
-
-
-
+
+
+
+
-
-
+
+
@@ -27,7 +27,7 @@
-
+
diff --git a/templates/integrated/Source/Program.cs b/templates/integrated/Source/Program.cs
index 3569681..056adae 100644
--- a/templates/integrated/Source/Program.cs
+++ b/templates/integrated/Source/Program.cs
@@ -7,7 +7,7 @@
bld.Services
.AddAuthenticationJwtBearer(o => o.SigningKey = bld.Configuration["Auth:SigningKey"])
.AddAuthorization()
- .AddFastEndpoints(o => o.SourceGeneratorDiscoveredTypes.AddRange(DiscoveredTypes.All))
+ .AddFastEndpoints(o => o.SourceGeneratorDiscoveredTypes = DiscoveredTypes.All)
.AddJobQueues()
.AddSingleton(
new AmazonSimpleEmailServiceV2Client(
@@ -36,7 +36,12 @@
app.UseAuthentication()
.UseAuthorization()
- .UseFastEndpoints(c => c.Errors.UseProblemDetails());
+ .UseFastEndpoints(
+ c =>
+ {
+ c.Binding.ReflectionCache.AddFromMyProject();
+ c.Errors.UseProblemDetails();
+ });
await InitDatabase(app.Configuration["Database:Name"]);
diff --git a/templates/project/Source/Features/SayHello/Request.cs b/templates/project/Source/Features/SayHello/Request.cs
index adc3a8c..f28b0a1 100644
--- a/templates/project/Source/Features/SayHello/Request.cs
+++ b/templates/project/Source/Features/SayHello/Request.cs
@@ -4,8 +4,8 @@ namespace SayHello;
sealed class Request
{
- public string FirstName { get; init; }
- public string LastName { get; init; }
+ public string FirstName { get; set; }
+ public string LastName { get; set; }
internal sealed class Validator : Validator
{
diff --git a/templates/project/Source/MyProject.csproj b/templates/project/Source/MyProject.csproj
index 8433456..13ec1e1 100644
--- a/templates/project/Source/MyProject.csproj
+++ b/templates/project/Source/MyProject.csproj
@@ -10,10 +10,10 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/templates/project/Source/Program.cs b/templates/project/Source/Program.cs
index 7b44c25..40d62ce 100644
--- a/templates/project/Source/Program.cs
+++ b/templates/project/Source/Program.cs
@@ -2,13 +2,18 @@
bld.Services
.AddAuthenticationJwtBearer(s => s.SigningKey = bld.Configuration["Auth:JwtKey"])
.AddAuthorization()
- .AddFastEndpoints(o => o.SourceGeneratorDiscoveredTypes.AddRange(DiscoveredTypes.All))
+ .AddFastEndpoints(o => o.SourceGeneratorDiscoveredTypes = DiscoveredTypes.All)
.SwaggerDocument();
var app = bld.Build();
app.UseAuthentication()
.UseAuthorization()
- .UseFastEndpoints(c => c.Errors.UseProblemDetails())
+ .UseFastEndpoints(
+ c =>
+ {
+ c.Binding.ReflectionCache.AddFromMyProject();
+ c.Errors.UseProblemDetails();
+ })
.UseSwaggerGen();
app.Run();
diff --git a/templates/project/Tests/Tests.csproj b/templates/project/Tests/Tests.csproj
index e573c2e..96806ca 100644
--- a/templates/project/Tests/Tests.csproj
+++ b/templates/project/Tests/Tests.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/templates/test/Tests/Tests.csproj b/templates/test/Tests/Tests.csproj
index b3c1cb4..a223e7b 100644
--- a/templates/test/Tests/Tests.csproj
+++ b/templates/test/Tests/Tests.csproj
@@ -9,7 +9,7 @@
-
+