Discover and read the best of Twitter Threads about #dotNet

Most recents (24)

Are you struggling to find right resources to learn C# and .NET then check these out ?

๐˜๐จ๐ฎ๐“๐ฎ๐›๐ž ๐‚๐ก๐š๐ง๐ง๐ž๐ฅ๐ฌ
- Dotnet (bit.ly/3L2CUqn)
- Edureka (bit.ly/3GLdT0k)
- Brackeys (bit.ly/3zYDMWA)
- Kudvenkat (bit.ly/3MGsSfK)๐Ÿงต๐Ÿ‘‡

#dotnet
- QuestPond (bit.ly/3N303KP)
- Nick Chapsas (bit.ly/3MKFhiz)
- Derek Banas (bit.ly/41wU9FM)
- Milan Jovanoviฤ‡ (bit.ly/3zXoPEi)
- I am Tim Corey (bit.ly/3UD0zAI)
- FreecodeCamp (bit.ly/3GMDVQC)
- NDC Conferences (bit.ly/419dPQc)
- Programming with Mosh (bit.ly/3KEuLqL)

๐Œ๐ข๐œ๐ซ๐จ๐ฌ๐จ๐Ÿ๐ญ ๐•๐ข๐๐ž๐จ ๐“๐ฎ๐ญ๐จ๐ซ๐ข๐š๐ฅ๐ฌ
- C# (bit.ly/41l0qEg)
- Desktop (bit.ly/3o82scH)
- ASP .NET (bit.ly/413blCU)
Read 10 tweets
Why should we use NodaTime over Default .NET DateTime ?

These are the 7 reasons

1) Lack of clarity in DateTime especially when comparing local and UTC times๐Ÿ”ฝ๐Ÿ‘‡

#dotnet Image
2) DateTimeKind property and various operations like ToUniversalTime() and ToLocalTime() can lead to unexpected results

3) DateTime does not provide a comprehensive solution for handling time zones.

#dotnet
4) TimeZoneInfo, used in .NET, relies on Windows time zone IDs, which may differ from widely used Olson (tz) identifiers

5) Unfortunately humanity didโ€™ not agree on single calendar (Gregorian, Julian, Coptic and Buddhist) , NodaTime covers this space which default lacks

#dotnet
Read 5 tweets
๐Ÿ“ฃ .NET Developer Roadmap ๐Ÿš€

โžก๏ธ Learn C# and .NET Development efficiently.

ยท The .NET Platform
ยท Development Environment
ยท Basic C#
ยท OOP in C#
ยท Intermediate C#
ยท Arrays & Collections in C#
ยท Advanced C#
ยท Introduction to LINQ
ยท Basic Testing in C#.

๐Ÿงต๐Ÿ‘‡ #dotnet #developers Image
โžก๏ธ 1.) The .NET Platform

ยท The History of .NET
ยท What is modern .NET?
ยท Why learn .NET?
ยท What can you build?
ยท The .NET Documentation
โžก๏ธ 2.) Development Environment

ยท The History of .NET
ยท What is modern .NET?
ยท Why learn .NET?
ยท What can you build?
ยท The .NET Documentation
Read 16 tweets
What is the simplest way to create middleware in .NET?

Middleware allows you to introduce additional logic before or after executing an HTTP request.

There are three approaches to creating middleware:
- With Request Delegates
- By Convention
- Factory-Based

#dotnet Image
The simplest one is using request delegates.

But you're missing out on:
- Strong typing
- Dependency injection

I think it makes sense for simple use cases.
If you want to learn more about .NET and software architecture, consider subscribing to my newsletter.

โ†’ Join 22.000+ engineers here: milanjovanovic.tech
Read 3 tweets
Clean Architecture Solution Layers in .NET

Clean architecture is an architecture that follows set of design principles (mostly SOLID) and divides the solution into different layers (mostly 4 layers).

- Domain
- Application
- Infrastructure
- Presentation ๐Ÿงต โฌ‡๏ธ
#dotnet Image
Domain : It contains core business entities and domain logics

Application :Responsible for communicating with domain and handle use cases.

Infrastructure layer contains implementations of external services and interfaces for example logging or repositories.
#dotnet
Presentation is related to user interface (UI) part and we deal with things that are visible to users e.g. (Razor Pages or F.E Angular/React)

If you like it you would be interested in my weekly .NET newsletter as well.
Join with 2800+ here : buff.ly/3pCmHQk

#dotnet
Read 3 tweets
What is the difference b/w field and property , what are the different types of properties in C# ?

- Properties
- Field vs Properties
- 6 Types of Properties

#dotnet Image
Properties vs Field

- Properties are first class citizens in C#
- We used properties to achieve abstraction
- Properties are implemented via accessors
- Enable developers to write code that accurately expresses their design intent
#dotnet Image
Read only Properties

- Serve the purpose of getters
- Use them for retrieving the information in DTO
- We can not set them

#dotnet Image
Read 8 tweets
Adapter Design Pattern - Simplifed๐Ÿ’ก

Definition:

The adapter pattern converts the interface of a class into another interface clients expect. The adapter lets classes work together that couldnโ€™t otherwise because of incompatible interfaces.

#Dotnet Image
Real-Wolrd Analogy:

โ€ขย Stefan from Serbia arrived in the UK.
โ€ขย Stefan has a classic EU charger with a two-part outlet.
โ€ขย The UK has a standard three-part plug.

How will Stefan charge his phone? Image
Answer: By using an adapter.

The adapter creates the possibility of connecting two different interfacesย 
(2 plugs).ย 
It gets one type of input and produces a different type of output. Image
Read 5 tweets
How to increase productivity?

5 Visual Studio Refactoring Tips ๐Ÿ’ก

If we use ๐•๐ข๐ฌ๐ฎ๐š๐ฅ ๐’๐ญ๐ฎ๐๐ข๐จ as an ๐ˆ๐ƒ๐„, it can help us a lot to quickly and successfully refactor the code.

Visual Studio makes things easy for us and has support for a lot of code changes.

#Dotnet Image
โ€ข ๐‘๐ž๐ง๐š๐ฆ๐ข๐ง๐  ๐ข๐๐ž๐ง๐ญ๐ข๐Ÿ๐ข๐ž๐ซ

Use ๐‚๐ญ๐ซ๐ฅ+๐‘, ๐‘ - when you change the name of a variable in one place, all references are automatically changed.
โ€ข ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐Œ๐ž๐ญ๐ก๐จ๐

The hotkeyย ๐‚๐ญ๐ซ๐ฅ+. triggers theย ๐๐ฎ๐ข๐œ๐ค ๐€๐œ๐ญ๐ข๐จ๐ง๐ฌ ๐š๐ง๐ ๐‘๐ž๐Ÿ๐š๐œ๐ญ๐จ๐ซ๐ข๐ง๐ ๐ฌ menu. From this menu, we can chooseย ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐Œ๐ž๐ญ๐ก๐จ๐ orย ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐‹๐จ๐œ๐š๐ฅ ๐…๐ฎ๐ง๐œ๐ญ๐ข๐จ๐งย ๐„๐ฑ๐ญ๐ซ๐š๐œ๐ญ ๐‹๐จ๐œ๐š๐ฅ ๐…๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง.
Read 6 tweets
I almost started working on a new project. ๐Ÿš€

These are the 4 steps I follow before coding: ๐Ÿงต

#Dotnet
1. Requirements Gathering

I try to have a deep understanding of project goals, functionality, and user expectations. Therefore, I believe that clear communication at this stage lays the foundation for a successful outcome.
2. Software Architecture

I carefully create the pieces of the software architecture. I analyze all client requirements and consider factors such as scalability, performance, security, and maintainability. I do this together with the client.
Read 6 tweets
C# | .Net Tip ๐Ÿ’ก

๐‡๐จ๐ฐ ๐ญ๐จ ๐ข๐ง๐œ๐ซ๐ž๐š๐ฌ๐ž ๐ญ๐ก๐ž ๐ซ๐ž๐š๐๐š๐›๐ข๐ฅ๐ข๐ญ๐ฒ ๐จ๐Ÿ ๐ฒ๐จ๐ฎ๐ซ ๐œ๐จ๐ง๐Ÿ๐ข๐ ๐ฎ๐ซ๐š๐ญ๐ข๐จ๐ง ๐œ๐จ๐๐ž?

I'm sure everyone reading this post has heard of ๐ž๐ฑ๐ญ๐ž๐ง๐ฌ๐ข๐จ๐ง ๐ฆ๐ž๐ญ๐ก๐จ๐๐ฌ. ๐Ÿงต

Good practice at the end of the post. ๐Ÿ‘Œ

#Dotnet Image
When creating an application, the first thing we do is configure it.

We configure: logging, connect the database with ORM, and configure CORS.
We define the method of authentication, DI services, and various bindings.
When we write all this code in theย ๐‚๐จ๐ง๐Ÿ๐ข๐ ๐ฎ๐ซ๐ž๐’๐ž๐ซ๐ฏ๐ข๐œ๐ž๐ฌ ๐ฆ๐ž๐ญ๐ก๐จ๐ ๐ข๐ง ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ.๐œ๐ฌ, everything gets messy. These methods can reach over 500 lines of configuration code.
Changing something is very difficult to navigate. Image
Read 9 tweets
๐Ÿ’ก๐ƒ๐จ๐งโ€™๐ญ ๐‘๐ž๐ฉ๐ž๐š๐ญ ๐˜๐จ๐ฎ๐ซ๐ฌ๐ž๐ฅ๐Ÿ (๐ƒ๐‘๐˜) ๐๐ซ๐ข๐ง๐œ๐ข๐ฉ๐ฅ๐ž

It states that donโ€™t repeat yourself what it means it is saying donโ€™t duplicate code , avoid duplication. Purpose is to reduce the redundant code in your application ๐Ÿงตโฌ
#dotnet Image
Following the DRY Principle can give us following benefits

1.ย  Improved maintainability of code

2.ย  Reduces the risks of bugs

3.ย  Code becomes easier to understand

#dotnet
If you are not applying DRY Principle you need to test/debug all process separately for similar code.

We can fulfil DRY Principle using Inheritance and Polymorphism.

#dotnet
Read 5 tweets
๐Ÿš€ 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
๐Ÿ’ก NULL Operators Guide in C#

- Ternary Operator (? :)

- Null Forgiving Operator (!.)

- Null Conditional Operator (?.)

- Null Coalescing Operator (??)

- Null Coalescing Assignment Operator (??=) ๐Ÿงตโฌ

#dotnet Image
Ternary Operator or Conditional Operator(?.) ย is used to evaluate a condition and then we can do something on that basis for true and false

#dotnet
Null Forgiving or Null Suppression Operator (!.) ย is used to suppress all nullable warnings for preceding expression. It has no effect on runtime

#dotnet
Read 7 tweets
What is the required keyword in C#?

It was added in C# 11.

When creating a new object instance, you can use the required keyword to indicate that a field or property must be initialized.

Have you used the C# required keyword already?

#dotnet Image
If you try to create a new object instance and don't assign a value to a required property, you'll get a compile error.

Before this, you had to use constructors with all the required values as parameters.
Now you can also work with object initializers and not worry about members not having a value assigned.

In combination with nullable reference types, you can create a robust design.
Read 4 tweets
๐Ÿ’กHTTP Client Class in C#

. Introduction
Methods
Properties
Dependency injection ๐Ÿงตโฌ

#dotnet Image
HttpClient is a class in C# that is used for making HTTP calls of different kinds (most commonly Get/Put/Delete/Post).This class comes from namespace System.Net.Http
Most commonly used methods of this class are
- GetAsync
- DeleteAsync
- PostAsync
- PutAsync
- Dispose

#dotnet
Read 5 tweets
๐Ÿ’ก 15+ .NET Libraries you should Know

Now a days libraries play an important role in your development, start learning these librariesย for a good development experience.

- Mediator for CQRS
- Dapper for micro-ORM

See more๐Ÿงตโฌ
#dotnet Image
- Serilog and NLog for logging

- Bogus for fake data generation

- Fluent Validation for validations

- SignalR for real time communication

- Moq for mock interfaces and classes

- Hangfire and Quartz for background jobs

- Noda Time best in the town for date-time

#dotnet
- Autofac for Dependency Injection Container

- MiniProfiler for profiling your application

- Automapper, Mapster and Mapperley for Mappings

- Polly for fault handling (Retry, Circuit Break)

#dotnet
Read 5 tweets
Clean architecture aka ports and adapters is simply an approach to building systems that follow DIP. That is, depend on abstractions not implementations, and make sure those abstractions donโ€™t depend on details.
#dotnet #cleanarchitecture
It doesnโ€™t make exceptions for different kinds of implementations. It doesnโ€™t exclude web services or email sending or file system access. Why would it be inconsistent about persistence or ORM usage?
If you find it useful to bypass using an abstraction (you control) in favor of relying directly on an implementation detail, go ahead and do so! Your app will still work! But the first law of architecture is everything is a trade off so just understand the pros and cons.
Read 4 tweets
๐Ÿ’กIEnumerable vs IQueryAble in .NET

1) Whatis IEnumerable
2) What is IQueryAble
3) Difference b/w them โฌ

#csharp #dotnet
IEnumerable and IQueryable interfaces are both used to work with collections of data and both support LINQ (Language Integrated Query)
#dotnet
๐ˆ๐๐ฎ๐ž๐ซ๐ฒ๐š๐›๐ฅ๐ž

โœ… IQueryable executes queries on the server side.

โœ… It is designed specifically to work with LINQ

โœ… It extends IEnumerable, which means it includes all of the functionality of IEnumerable.
#dotnet
Read 7 tweets
๐Ÿ’กTracking vs Non Tracking Queries in .NET
1) Tracking Queries
2) Non Tracking Queries
3) Identity Resolution
4) How to set tracking by default for context๐Ÿงต๐Ÿ”ฝ
#dotnet
๐“๐ซ๐š๐œ๐ค๐ข๐ง๐  : By default all queries are tracked , so behind the seen a change tracker keeps working on each entity. If you want to perform Update/Delete then you should use tracking.
#dotnet
๐๐จ๐ง ๐“๐ซ๐š๐œ๐ค๐ข๐ง๐  : If you just need read only data then you don't need your queries to keep tracking of change , you can simply go with no tracking and help the query run more speedy.
#dotnet
Read 7 tweets
๐Ÿ’กGlobal Error Handling in .NET ?
1) Why we need it
2) Pros and cons
3) Code implementation๐Ÿงต๐Ÿ”ฝ

#dotnet Image
While working with .NET application we sometime come up with exception and we can deal with it in two ways , either by using try catch block in each class (controller level or service level) or we can define a centralized and global point to catch the exception.
#dotnet
โ™‰ Pros of using Global Exception

1. It provides us a centralized error handling point and makes easier for us to manage.

2. Code readability is improved as we get rid of writing try-catch code in each method
#dotnet
Read 5 tweets
๐Ÿ’ก Life of Query in EF

๐’๐ญ๐ž๐ฉ ๐Ÿ : The LINQ Query is processed by EF Core and build an representation that is processed by database provider, and the result is cached later on so we don't need to process it every time #dotnet

See thread ๐Ÿงตโฌ
๐’๐ญ๐ž๐ฉ ๐Ÿ : The result is passed to the db provider and db provider identifies which parts of query can be evaluated in db, these parts are then translated into query language (e.g. SQL) after that translated query is sent to db and db returns results (but not entity instances)
๐’๐ญ๐ž๐ฉ ๐Ÿ‘ : For each item we check if it is tracking query EF checks the data in existing change tracker if found relevant entity is returned else new is created, its change tracking get set up and it is returned

For non tracking a new entity is always created and returned.
Read 5 tweets
๐Ÿ’ก 7 Tips to write better LINQ Queries

๐”๐ฌ๐ž ๐จ๐Ÿ ๐€๐ฌ๐๐จ๐“๐ซ๐š๐œ๐ค๐ข๐ง๐  : For read only queries e.g. (GetAll,GetById etc.) use AsNoTracking , when we use it entities are not tracked for change so it brings data more speedily. #dotnet

See thread ๐Ÿงต๐Ÿ”ฝ
๐ˆ๐ง๐œ๐ฅ๐ฎ๐๐ž ๐ง๐ž๐œ๐ž๐ฌ๐ฌ๐š๐ซ๐ฒ ๐„๐ง๐ญ๐ข๐ญ๐ข๐ž๐ฌ ๐š๐ง๐ ๐‚๐จ๐ฅ๐ฎ๐ฆ๐ง๐ฌ : While retrieving data from multiple table make sure to include only necessary tables and columns Use eager loading only when it is necessary.
#dotnet
๐…๐จ๐ซ ๐ฅ๐š๐ซ๐ ๐ž ๐๐š๐ญ๐š ๐ฎ๐ฌ๐ž ๐’๐ค๐ข๐ฉ ๐š๐ง๐ ๐“๐š๐ค๐ž : Use skip and take to retrieve data from table for large collections because if we try to bring all data in single try it can take time that will give bad user experience takes next values.
#dotnet
Read 8 tweets
๐Ÿ’ก How to store Password in Database

Three common practices that are used for passwords, but first two has some serious issues.

โœ”๏ธ Plain text password
โœ”๏ธ Hashed password
โœ”๏ธ Hashed password with Salt
โœ”๏ธWhat is Salt
โœ”๏ธHow to validated hash password

#dotnet

#csharp #dotnet
1๏ธโƒฃ Plain Text Password
Saving password in plain text is the worst approach because it is open to everyone who has database access and an easy target for attackers. Its not recommended at all.
2๏ธโƒฃ Hashed Password
Hashing the plain text password first and then saving it, it seems safe but it isnโ€™t safe again, you can fall for attack in this case as well rainbow attack.
Read 7 tweets
๐Ÿ’ก Do and Don't for string in C#

1. Always use
2. Don't use ๐Ÿ”

โœ‰๏ธIf you like my tweets, please join 400+ Software Engineers to receive an actionable tip weekly in your inbox through my Newsletter.(lnkd.in/d69Va5CM)

#csharpย #dotnetย #dotnetcore
โœ…Use an overload of theย String.Equalsย method to test whether two strings are equal

โœ…Use theย String.Compareย andย String.CompareToย methods to sort strings, not to check for equality.
โœ…Use overloads that explicitly specify the string comparison rules for string operations. Typically, this involves calling a method overload that has a parameter of typeย StringComparison.
Read 8 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!