Questions tagged [carter]

Carter is a library that allows Nancy-esque routing for use with ASP.Net Core

It is not a framework, it simply builds on top of Microsoft.AspNetCore.Routing allowing you to have more elegant routing rather than have attribute routing, convention routing, ASP.Net Controllers or IRouteBuilder extensions.

GitHub Repository

7 questions
2
votes
1 answer

Minimal API Service not injected using .NET Carter

I´m creating an API in .NET using Carter. I have this Module Defined: public class VariationsModule : EntityModule { public VariationsModule() { this.MainRoute = "api/variations"; } …
0
votes
0 answers

Where should HttpContext.Response.Redirect("~/") go?

I'm a bit confused about the ~ path in Asp.NET 6.x Assume my Web site is hosted on IIS at: http://somesite.org/special/ I'm using Carter Lib but I don't think that should matter. public LogoutModule() { Get("/api/admin/logout", async…
Mike Ward
  • 3,211
  • 1
  • 29
  • 42
0
votes
1 answer

Image sent to my webservice is always null using Carter framework

I am having a small issue where the image im sending from postman is not populated into my model when using BindAndValidate method. Here is my model : public class Photo { public string date {get; set;} public byte[] image {get; set;}…
Matias Barrios
  • 4,674
  • 3
  • 22
  • 49
0
votes
1 answer

Add mock fetcher instead of real class using Carter framework

Im doing integration testing on my rest web api. I have the following setup : public ItemsControllerTests() { this.itemFetcher = new Mock(); this.itemFetcher.Setup(sp =>…
Matias Barrios
  • 4,674
  • 3
  • 22
  • 49
0
votes
0 answers

Unable to unit test simple endpoint with Carter in C Sharp

Im trying to unit test my REST web api coded in C Sharp Carter framework using ASP.NET TestHost Version 2.1 This is my endpoint : namespace Api { public class HealthModule : CarterModule { public HealthModule() { …
Matias Barrios
  • 4,674
  • 3
  • 22
  • 49
0
votes
1 answer

Adding middleware in Carter framework makes some URL to not trigger

I have successfully added some custom logging to my request using Carter in C#. this is what my startup.cs code looks like : public void Configure(IApplicationBuilder app,IHostingEnvironment env) { app.UseCarter(this.RequestId()) …
Matias Barrios
  • 4,674
  • 3
  • 22
  • 49
-1
votes
1 answer

ASP .Net Core RESTful App Deployed as Windows Service is not Working / Starting

I am working with some sort a small RESTful layer to expose (to the internet) the local application data in a host machine. It behaves like a typical web service that listens incoming request to a port. I wrote it with ASP .NET Core 3.1 with a tiny…
Ariel Magbanua
  • 3,083
  • 7
  • 37
  • 48