Discover and read the best of Twitter Threads about #aspnetcore

Most recents (21)

🚀 Backend Developer Roadmap for .NET Developers. (2023 Edition)

Follow this thread along for the entire roadmap.

#dotnet #developer #backend Image
Step 0: Know your basics.
Be familiar with OOPS, Brush up your problem solving skills, and learn GIT.
#dotnet #developer #backend Image
Next, get your C# skills right to the latest changes. #dotnet #developer #backend #csharp Image
Read 23 tweets
We're working on making ASP.NET Core and EntityFramework work with trimming and ahead of time compilation (.NET NativeAOT). One of the big challenges is moving away from dynamic runtime code generation. Let's talk about what that means👇🏾 #dotnet #aspnetcore
Why do we care about trimming and NativeAOT? Faster startup and smaller output. This is useful for reducing the size of your output, which can be impactful for things like smaller container images.
When you type write a minimal API, the framework will look at the method signature you pass and generate the appropriate code to pass the expected parameters and process the response. The two examples below are mostly equivalent.
Read 17 tweets
Declarative VS imperative, which do you prefer and why? #dotnet #aspnetcore ImageImage
What about now? ImageImage
I don't think one of these is better than the other, but to show how removing indirection can make the understanding of what the code is doing simpler: ImageImage
Read 4 tweets
Here’s another “auth is hard in .NET” thread reddit.com/r/dotnet/comme… #dotnet #aspnetcore
To help the team contextualize why it is hard outside of the domain itself being hard, it would be great to see some code samples. Samples from other frameworks that are runnable. Most of these threads conflate everything under the auth banner and require 20 questions understand
the problem. It’s fine to rant but we want to make real improvements. After the rant please show the code. We need to understand the scenario, the exact scenario. Sharing code leaves less room for ambiguity.
Read 10 tweets
This thread was good because it helped clarify my thinking. There are 2 phases (for simplicity) where ClaimsPrincipal shows up:
- The authentication flow
- The authorization flow

Claims are typically used to store authentication data. #dotnet #aspnetcore 🧵👇🏾
That data is then used to look up more user information (profile data) usually store in a database/cache. This profile data usually also contains permissions and authorization rules are then run over this user for different types of application "resources".
These resources typically include (but are not restricted to):
- The HTTP endpoint
- Some business object

The authorization process usually needs access to all user profile information including permissions to do authorization checks.
Read 11 tweets
New feature that came out with minimal APIs in .NET 7 preview 5 (devblogs.microsoft.com/dotnet/asp-net…), the ability to declare parameter list surrogates: #dotnet #aspnetcore
You can refactor long argument lists into structs as a "zero cost abstraction". The struct's members will be bound as if they were parameters declared on the method.
It's not all or nothing, you can also do this with a subset of the parameters:
Read 5 tweets
Today's #aspnetcore decoder-ring thread🧵:

AspNetCore.Identity
Allows storing users inc. passwords in your app, login & acct management, Twitter/FB/social login, etc.
docs.microsoft.com/aspnet/core/se…
1/5
AspNetCore.Authentication/Authorization
Base AuthN/AuthZ APIs for using/implementing AuthN schemes (cookie, JWT, OIDC, etc.) & AuthZ rules (roles, policies, attributes, etc.) in your app.
docs.microsoft.com/aspnet/core/se…
2/5
MS Identity
Diff. team that owns Azure identity services inc. support for Azure AD, OAuth, OIDC, MS Graph, etc.
docs.microsoft.com/azure/active-d…
3/5
Read 6 tweets
A Thread 🧵

In this video from @nickchapsas, he recommends _not_ throwing exceptions in #csharp and instead using the "Result" type (a monad 🧐) to model failures.

I've been using this approach for several years now and I can say it _works very well_!

I have multiple blog posts and presentations talking about this topic and the topic of modeling failures/optional data in #csharp. These links are mostly in the context of @KenticoXP, the platform @wiredviews uses to build websites for our clients.

(links at the end)
Here are some of my thoughts on why we should use Result vs Exception for modeling failures.

Don't forget 🤔, we use language features to model real world events in code, so we should consider the tools we have available and what their merits/costs are...
Read 10 tweets
Our hackathon project this year was working on making it easier to incrementally migrate large ASP.NET projects to https://t.co/4PmXMQN7SX Core. Here's the MVC music store app: #dotnet #aspnetcore Image
Most pages are running on .NET Framework but the shopping cart is managed by ASP.NET Core. This application is 10 years old and using both technologies at the same time, sharing source where possible. Image
This is made possible because both applications are running in the same IIS pipeline using different modules. It's sharing session and auth with the existing application without many changes to it. The ASP.NET Core application is part of the larger application.
Read 6 tweets
If you are queuing background jobs/work items today in your .NET applications, how are you doing it and what are you using it for? #dotnet #aspnetcore
What about non-durable background work?
Is anyone using the DurableTasks for job scheduling? github.com/Azure/durablet…
Read 4 tweets
As usual, there are a boatload of new APIs coming in .NET 6. Most of these are driven by custom requests. Lets talk about some of them. #dotnet #aspnetcore
In .NET 6, there's a new low-level API to enable reading/writing of files without using a FileStream. It also supports scatter/gather IO (multiple buffers) and overlapping reads and writes at a given file offset. Image
There are a couple of new ways to access a process path and process id without allocating a new process object: Image
Read 16 tweets
Essa é uma thread sobre as novidades do #MSBuild. Cada tuite terá uma das novidades que achei mais interessantes pra devs. Vem junto, tem muita coisa legal!
Azure Application Services (App SErvice, Functions, Logic Apps, Event Grid e API Management) agora rodam no Kubernetes (em preview), em qualquer lugar onde você tenha k8s, até em outras clouds. Incrível!
techcommunity.microsoft.com/t5/azure-arc/b…
azure.microsoft.com/en-us/blog/bui…
Azure API Management agora suporta websockets (em preview), e dá pra aplicar políticas nas conexões. Mas não todas, pq nem todas fazem sentido.
docs.microsoft.com/en-us/azure/ap…
Read 15 tweets
The transition to asynchronous code changes a lot of the basics we're used to. There's usually much more concurrency in these systems and that becomes more challenging to diagnose when things go wrong. #dotnet #aspnetcore
The threads are usually switching between lots of concurrent operations as various IO operations complete. Here's an example of visualizing lots of concurrent operations happening in the parallel tasks window. The right is parallel stacks. Async stacks vs OS thread stacks.
Essentially the async logical stacks are linked lists of objects stored on the heap. There may not be any code executing if a request is waiting on IO for example.
Read 5 tweets
Single File Application using FeatherHttp, C#9 top level statements and records. WIP.

#aspnetcore
LiteDB 5 doesn't support async methods yet (github.com/mbdavid/LiteDB…). It's coming at 5.5.
For building HTML, I can use nuget.org/packages/HtmlB…
Read 23 tweets
who can fix this #dotnetcore #aspnetcore #vscode #intellisense issue on #macos. This is a horrible #dotnet new mvc experience
#vscode latest
Read 7 tweets
@Nick_Craver @shanselman @mayankdotnet a few things to consider:

2.1 is 15 months through it's 3 year support lifecycle. That means it certainly has had a bunch of fixes to make it more "stable", but of course those are all in 3.0 too :)
@Nick_Craver @shanselman @mayankdotnet 3.1 will be out shortly (Dec) and will be LTS, giving a fresh 3 year support term. Moving from 3.0 to 3.1 should be trivial.
@Nick_Craver @shanselman @mayankdotnet 3.0 of course has new features that can introduce instability, but it was by far the highest used version during previews we've ever had, and is the fastest adopted version of .NET Core ever by a huge margin. We haven't had to issue a patch due to stability problems so far
Read 5 tweets
One of the beauties of shared abstractions is once the ecosystem starts to take advantage of them, adding value becomes that much more impactful. This is one of the goals of Microsoft.Extensions.* that we built while developing ASP.NET Core #dotnetcore #aspnetcore
It serves as a building block for what we call "application models" and attempts to handle the boring boilerplate and cross cutting concerns like dependency injection, logging and configuration.
The strategy is multi pronged:
- Introduce libraries with minimal dependencies that other libraries can take a dependency on without too much burden (ILogger, IConfiguration, IOptions, IHostingEnvironment) etc.
Read 7 tweets
This is a good addition to .NET - the Stack Overflow scheduler is based on IHostedService, and we have a lot of other plans for it too.
Some examples of queues we have at Stack:
- The aggregator, which puts stuff in network-level tables for things like reputation in your top bar.
- Account queues, for merging/deleting users and such.
- GDPR request completion
- Elasticsearch indexing
- Related question rebuilds
We've moved them to a common "service" type implementation with shared logging, locking, and status reporting infrastructure. They're currently async/await Task.Delay style node competition services we'll move to IHostedService in the move to #AspNetCore.
Read 7 tweets
Oh hey, we haven't talked about .NET Core in a while. We've been making some progress, here's what's been going on over at Stack Overflow...
- @marcgravell and I shipped SE.Redis v2.0
- I'm porting everything to EF Core (not 100% yet)
- @m0sa has been working on MoonSpeak (localization) and performance with Marc
- @deanward81 has been tearing out loads of old email code to finish the StackMail migration
@marcgravell @m0sa @deanward81 - @kevinmontrose has been suffering through auth code to deprecate openid.stackexchange.com and move us to all-OAuth (and simplify things), allowing us to kill DotNetOpenAuth usage.
- The rest of the teams are progressing on other work while we advance the .NET Core initiative
Read 19 tweets
Been asked several times this week about "right tool for the right job". Do I believe in it? Absolutely.

I help maintain Dapper, the most popular third party ORM in .NET, yet I'm contributing to EF Core at the moment. The goal is helping developers; both tools do that.
Some people like raw SQL, ultimate flexibility, and things generated SQL can't sanely do. We do. We built Dapper around it.

Some people like easier development and data models, EF Core is for them.

These aren't distinct groups. We're about to be using *both* at Stack Overflow.
When someone asks about inserting object graphs which have rows across several tables and want to do it all raw...it sounds great, **if it stays simple**. When it gets complex: you're basically then building a data context. We would be. But why? EF Core exists. We'll use it.
Read 10 tweets
Ok tweeting about some hidden gems in the release that people may not know about. #aspnetcore #dotentcore
First, the generic host docs.microsoft.com/en-us/aspnet/c…. We like the hosting model of ASP.NET Core and think it should exist in more application types. #dotnetcore #aspnetcore
Next, IHostedService. A way to run long running background operations in both the generic host and in your web hosted applications. docs.microsoft.com/en-us/aspnet/c…. 2.1 added support for a BackgroundService base class that makes it trivial to write a long running async loop.
Read 12 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!