-
𝗦𝗶𝗻𝗴𝗹𝗲 𝗥𝗲𝘀𝗽𝗼𝗻𝘀𝗶𝗯𝗶𝗹𝗶𝘁𝘆 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲 (𝗦𝗥𝗣) - A class should have only one reason to change. This means that a class should have a single, well-defined responsibility and that responsibility should be entirely encapsulated by the class.
-
𝗢𝗽𝗲𝗻/𝗖𝗹𝗼𝘀𝗲𝗱 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲 (𝗢𝗖𝗣) - Software entities (classes, functions, etc.) should be open for extension but closed for modification. This means that you should be able to add new functionality to a class without changing its existing code, but you should not need to modify the class itself to do so.
-
𝗟𝗶𝘀𝗸𝗼𝘃 𝗦𝘂𝗯𝘀𝘁𝗶𝘁𝘂𝘁𝗶𝗼𝗻 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲 (𝗟𝗦𝗣) - Subtypes must be substitutable for their base types. In other words, if a class is derived from another class, you should be able to use the derived class in the same way as the base class without any issues.
-
𝗜𝗻𝘁𝗲𝗿𝗳𝗮𝗰𝗲 𝗦𝗲𝗴𝗿𝗲𝗴𝗮𝘁𝗶𝗼𝗻 𝗣𝗿𝗶𝗻𝗰𝗶𝗽𝗹𝗲 (𝗜𝗦𝗣) - Clients should not be forced to depend on interfaces they do not use. This me
using System.Linq; | |
private readonly string[] authorizedSites = new string[] | |
{ | |
"https://site1.com", | |
"https://site2.com" | |
}; | |
private void SetAccessControlAllowOrigin() | |
{ |
public class MyDbContext : DbContext
{
public MyDbContext(DbContextOptions<MyDbContext> options) : base(options)
{
}
// .....
How to Build Visual Studio Installer Projects in Azure Pipelines
In a previous post, I mentioned I recently started working on a legacy WPF application. Before adding new features, we wanted to ensure that tests would cover the current functionality and that we could reliably build it for distribution. Since it was configured as a Visual Studio Installer Project, it made creating an Azure Pipeline more difficult than I originally anticipated.
Keep these tips in mind if you want to create a CI pipeline for your own Visual Studio Installer Project.
- DRY - Don't Repeat Yourself
- KISS - Keep It Simple Stupid
- YAGNI - You Aren't Gonna Need It (avoid creating extra complexity through adding functionality that you assume you may need in the future)
- Single Responsibility - every module or class should have only a single responsibility.
- Open/Closed - software entities should be open for extension but closed for modification.
- Liskov Substitution - objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
- Interface Segregation - small client-specific interfaces are better than one general-purpose interface.
- Dependency Inversion - use interfaces instead of concrete implementations.
In the recent Stack Overflow Developer Survey, .NET is marked as the most loved library, while ASP.NET is in the top 3 Web frameworks used by developers. If you want to become a full-stack or back-end developer in the Microsoft .NET stack or you want to improve your knowledge, it's not easy to find the right resources. Here is the list of curated resources that you can use:
- Microsoft Learn C#: https://lnkd.in/eVdEzvBd.
- Microsoft C# Fundamentals for Absolute Beginners: https://lnkd.in/e7iC2UUc.
- Udemy C# for Beginners - Coding From Scratch (.NET Core): https://lnkd.in/eGbiBwq2.
- C# Basics for Beginners: Learn C# Fundamentals by Coding: [https://lnkd.in/ewmfFUdC](https:
Top 50 .NET Interview Questions & Answers - Intellipaat
The rise in the number of job openings leads to a lot of vacancies and stiff competition to hire the most proficient .NET developers. With these questions, you will gain in-depth knowledge and insight into how to answer the most asked questions in a .NET interview. This guide has been carefully curated, considering many factors and including expert advice from multiple professionals and .NET experts.
Q1. What is.NET framework?
Q2. What are some of the common components of .NET?
Q3. What does JIT stand for in .NET?
Q4. What is the meaning of MSIL?