ready for arvan
parent
7aa057cd8c
commit
54312efb3b
|
@ -24,6 +24,21 @@ public class SeedController : ICarterModule
|
||||||
.WithDisplayName("SeedCategoriesAsync")
|
.WithDisplayName("SeedCategoriesAsync")
|
||||||
.HasApiVersion(1.0);
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapGet("test3", () =>
|
||||||
|
{
|
||||||
|
return TypedResults.Problem("Server Error 2 ( EXCEPTION THROWN )");
|
||||||
|
})
|
||||||
|
.WithDisplayName("SeedCategoriesAsync")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
|
||||||
|
group.MapGet("test3", () =>
|
||||||
|
{
|
||||||
|
return TypedResults.StatusCode(500);
|
||||||
|
})
|
||||||
|
.WithDisplayName("SeedCategoriesAsync")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
//group.MapPost("categories", SeedCategoriesAsync)
|
//group.MapPost("categories", SeedCategoriesAsync)
|
||||||
// .WithDisplayName("SeedCategoriesAsync")
|
// .WithDisplayName("SeedCategoriesAsync")
|
||||||
// .HasApiVersion(1.0);
|
// .HasApiVersion(1.0);
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<InvariantGlobalization>true</InvariantGlobalization>
|
<InvariantGlobalization>true</InvariantGlobalization>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
<AssemblyVersion>0.17.20.32</AssemblyVersion>
|
<AssemblyVersion>0.17.20.33</AssemblyVersion>
|
||||||
<FileVersion>0.17.20.32</FileVersion>
|
<FileVersion>0.17.20.33</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class ExceptionHandlerMiddleware
|
||||||
Formatting = Formatting.Indented
|
Formatting = Formatting.Indented
|
||||||
});
|
});
|
||||||
|
|
||||||
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
|
context.Response.StatusCode = 501;
|
||||||
context.Response.ContentType = "application/json";
|
context.Response.ContentType = "application/json";
|
||||||
await context.Response.WriteAsJsonAsync(result);
|
await context.Response.WriteAsJsonAsync(result);
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ public class ExceptionHandlerMiddleware
|
||||||
Formatting = Formatting.Indented
|
Formatting = Formatting.Indented
|
||||||
});
|
});
|
||||||
|
|
||||||
context.Response.StatusCode = (int)httpStatusCode;
|
context.Response.StatusCode = 501;
|
||||||
context.Response.ContentType = "application/json";
|
context.Response.ContentType = "application/json";
|
||||||
await context.Response.WriteAsJsonAsync(result);
|
await context.Response.WriteAsJsonAsync(result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue