Jan 29 2024

[ApiController] [Route("/api/[controller]")] public class ProductsController : ControllerBase { private static readonly List<string> Products = [ "Apple", "Milk", "Juice" ]; private readonly ILogger<ProductsController> _logger; public ProductsController(ILogger<ProductsController> logger) { _logger = logger; } [HttpGet(Name = "GetProducts")] public List<string> Get() { return Products; } }
[ApiController] [Route("/api/[controller]")] public class UsersController : ControllerBase { private static readonly List<string> Users = [ "Stefan", "Dajana", "Milan" ]; private readonly ILogger<UsersController> _logger; public UsersController(ILogger<UsersController> logger) { _logger = logger; } [HttpGet(Name = "GetUsers")] public List<string> Get() { return Users; } }
{ "GlobalConfiguration": {}, "Routes": [ {} ] }
{ "Routes": [ { "DownstreamPathTemplate": "/api/Products", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 5123 } ], "UpstreamPathTemplate": "/api/Products", "UpstreamHttpMethod": ["Get"] }, { "DownstreamPathTemplate": "/api/Users", "DownstreamScheme": "http", "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 5233 } ], "UpstreamPathTemplate": "/api/Users", "UpstreamHttpMethod": ["Get"] } ], "GlobalConfiguration": { "BaseUrl": "http://localhost:5165" } }
builder.Configuration.AddJsonFile("ocelot.json", optional: false, reloadOnChange: true); builder.Services.AddOcelot(builder.Configuration);
1. Design Patterns that Deliver
This isn’t just another design patterns book. Dive into real-world examples and practical solutions to real problems in real applications.Check out it here.
Go-to resource for understanding the core concepts of design patterns without the overwhelming complexity. In this concise and affordable ebook, I've distilled the essence of design patterns into an easy-to-digest format. It is a Beginner level. Check out it here.
Every Monday morning, I share 1 actionable tip on C#, .NET & Arcitecture topic, that you can use right away.
Join 18,000+ subscribers to improve your .NET Knowledge.
Subscribe to the TheCodeMan.net and be among the 18,000+ subscribers gaining practical tips and resources to enhance your .NET expertise.