Razor slice with name '/Slices/Home.cshtml' was found but it's model type is DateTime.
See original GitHub issueJust found this project and was considering adding it to a Carter extension package so you can content negotiate (which Carter already supports) HTML from the Carter/Minimal API routes.
Have followed the instructions but get the titled exception.
I also tried it with my own POCO as the model and get the same error
Any ideas?
System.InvalidOperationException: Razor slice with name '/Slices/Home.cshtml' was found but it's model type is DateTime.
at RazorSlices.RazorSlice.ResolveSliceFactoryImpl[TModel](String sliceName) in /_/src/RazorSlices/RazorSlice.ResolveAndCreate.cs:line 445
at RazorSlices.RazorSlice.ResolveSliceFactory[TModel](String sliceName) in /_/src/RazorSlices/RazorSlice.ResolveAndCreate.cs:line 292
at RazorSlices.RazorSlice.Create[TModel](String sliceName, TModel model) in /_/src/RazorSlices/RazorSlice.ResolveAndCreate.cs:line 353
at RazorSlices.RazorSlice.CreateHttpResult[TModel](String sliceName, TModel model, Int32 statusCode) in /_/src/RazorSlices/RazorSlice.CreateHttpResult.cs:line 58
at Microsoft.AspNetCore.Http.HttpResultsExtensions.RazorSlice[TModel](IResultExtensions resultExtensions, String sliceName, TModel model, Int32 statusCode) in /_/src/RazorSlices/HttpResultsExtensions.cs:line 53
at Carter.HtmlNegotiator.Razor.RazorResponseNegotiator.Handle(HttpRequest req, HttpResponse res, Object model, CancellationToken cancellationToken) in /Users/jonathan/Projects/Carter.HtmlNegotiator/src/Razor/RazorResponseNegotiator.cs:line 18
Issue Analytics
- State:
- Created 5 months ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
asp.net mvc 3 - Converting DateTime format using razor
I understand this is how Microsoft expects this to work, but it just seems data display formatting should be isolated to the view...
Read more >Razor syntax reference for ASP.NET Core
Razor is a markup syntax for embedding .NET based code into webpages. The Razor syntax consists of Razor markup, C#, and HTML. Files...
Read more >Dates And Times in a Razor Pages Form
These include options for managing the date and time, just the date or time, and for working with the month or week of...
Read more >Basics of Razor Pages - .NET Tools Guide
A complete Razor Pages pipeline. ... Razor Pages is a newer, simplified web application programming model. It removes much of the ceremony of...
Read more >Razor Slices
Razor Slices. CI (main) Nuget. Lightweight Razor-based templates for ASP.NET Core without MVC, Razor Pages, or Blazor, optimized for high-performance ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, it actually turned out to be a bit easier in that I could change the existing IResponseNegotiator to be generic =)
Thanks for the help
Yeah looking into adding a
IResponseNegotiator<T>
interface into Carter