Programming Tips ๐Ÿ’ก
51.7K subscribers
67 photos
10 videos
30 files
355 links
Programming & AI:
Tips ๐Ÿ’ก
Articles ๐Ÿ“•
Resources ๐Ÿ‘พ
Design Patterns ๐Ÿ’Ž
Software Principles โœ…

๐Ÿ‡ณ๐Ÿ‡ฑ Contact: @MoienTajik

๐ŸŽฏ Buy ads: https://telega.io/c/ProgrammingTip
Download Telegram
What is .NETโ“
What's C# and F#โ”
What's the .NET Ecosystemโ“
What can .NET buildโ”

Learn what is .NET from Scott Hanselman! โœ…

[ Youtube ] : https://www.youtube.com/watch?v=bEfBfBQq7EE

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#DotNet #CSharp
@ProgrammingTip
Looking inside ConfigurationManager in .NET 6 โœ…

ConfigurationManager was added to support ASP.NET Core's new WebApplication model, used for simplifying the ASP.NET Core startup code. ๐Ÿงน

However ConfigurationManager is very much an implementation detail. It was introduced to optimise a specific scenario (which I'll describe shortly), but for the most part, you don't need to (and won't) know you're using it.

In this post, We take a look at the ConfigurationManager class, why it was added, and some of the code used to implement it.


[ Article ] : https://kutt.it/cfg-mgr

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#DotNet #AspNetCore
@ProgrammingTip
Nuke Build ๐Ÿ—‚

As C# developers, we are spoiled with a great language and awesome IDEs.

Why do most automation systems never really match the level of convenience and integration that we're used to?

NUKE is different. ๐Ÿ’Ž

It is fully based on C# console applications and uses the type system to its full extent.

You want your auto-completion, package management, debugging, refactorings, formatting, and navigation back? Itโ€™s available right thereโ—๏ธ


[ Website ] : https://nuke.build/
[ GitHub ] : github.com/nuke-build/nuke

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#CSharp #Dotnet #BuildSystem
@ProgrammingTip
Source Link ๐Ÿž

Source Link is a language- and source-control agnostic system for providing first-class source debugging experiences for binaries.

The goal of the project is to enable anyone building NuGet libraries to provide source debugging for their users with almost no effort.

Microsoft libraries, such as .NET Core and Roslyn have enabled Source Link.

Source Link
is supported by Microsoft. โœ…

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#DotNet #CSharp #Debugging
@ProgrammingTip
ChilliCream GraphQL Platform ๐ŸŒถ

The ChilliCream GraphQL Platform, at its core, is a new way to create powerful Backends. HotChocolate, .NET GraphQL server, connects any service or data source and creates a cohesive service to offer your consumers a unified API. ๐Ÿ’Ž

Hot Chocolate: GraphQL server to create GraphQL endpoints and merge schemas. โœ…

Banana Cake Pop: GraphQL IDE to explore, request and analyze any GraphQL endpoint. ๐ŸŒ

Strawberry Shake: GraphQL client to fetch data from any GraphQL endpoint. ๐Ÿ”

Green Donut: DataLoader to solve the N+1 problem. ๐Ÿ”‚


[ GitHub ] : github.com/ChilliCream/hotchocolate

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#GraphQL #DotNet #AspNetCore
@ProgrammingTip
aspnetcore-developer-roadmap.png
606.9 KB
ASP.NET Core Developer Roadmap in 2023 ๐Ÿ”

Roadmap to becoming an ASP.NET Core developer in 2023 ๐Ÿš€

[ GitHub ] : https://github.com/MoienTajik/AspNetCore-Developer-Roadmap

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#AspNetCore #DotNet #DotNetCore #CSharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
WireMock.NET ๐Ÿ˜ฎ

WireMock.NET is a .NET library for stubbing and mocking HTTP services. With WireMock.NET, you can define the expected responses for particular requests, and the library will intercept and manage those requests for you. โœ”๏ธ

This allows for easy testing of the code that makes HTTP requests, without having to rely on the actual external service being available and without hacking HttpClient. ๐Ÿ†’

Sample code snippet:

[Test]
public async Task sample_WireMock_usage()
{
// Setup WireMock.Net server
using var wireMock = WireMockServer.StartWithAdminInterface(port: 1080, ssl: false);

// Setup WebApplicationFactory
await using var appFactory = new WebApplicationFactory<Program>().WithWebHostBuilder(builder =>
{
builder.ConfigureAppConfiguration(configurationBuilder =>
{
// Override downstream service addresses pointing to WireMock address
configurationBuilder.AddInMemoryCollection(new Dictionary<string, string>
{
["ExternalServices:WeatherService"] = "https://localhost:1080"
});
});
});

// Prepare stub for outgoing request
wireMock
.Given(
Request.Create()
.WithPath("/api/v1.0/weather")
.WithParam("lat", "10.99")
.WithParam("lon", "44.34")
.UsingGet()
)
.RespondWith(
Response.Create()
.WithStatusCode(200)
.WithHeader("Content-Type", "application/json; charset=utf-8")
.WithBodyAsJson(new
{
temp = 298.48,
feels_like = 298.74,
temp_min = 297.56,
temp_max = 300.05,
pressure = 1015,
humidity = 64
})
);

// Automate tested app
}


[ Blog ] : https://cezarypiatek.github.io/post/mocking-outgoing-http-requests-p1

ใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธใ€ฐ๏ธ
#UnitTest #DotNet #CSharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM