Thursday, February 20, 2025

.Net and core

 



SQL:

Get Highest salary of 3 employee without using limit,and top

SELECT StageID, DepartmentNumber, UserEmail
        ,DENSE_RANK() OVER (PARTITION BY DepartmentNumber
         ORDER BY UserEmail ASC) AS DRANK 
   FROM mytable 


Get full name from First name and last name of table

create view

SELECT CONCAT (FirstName, ' , ' , LastName) AS fullname (salary*12)+(experience*500) AS total FROM staff



𝐌𝐚𝐬𝐭𝐞𝐫𝐢𝐧𝐠 .𝐍𝐄𝐓 𝐂𝐨𝐫𝐞: 20  𝐟𝐫𝐨𝐦 𝐄𝐚𝐬𝐲 𝐭𝐨 𝐇𝐚𝐫𝐝

What is .NET Core, and how does it differ from .NET Framework?
What is the role of the Startup.cs file in an ASP.NET Core application?
What are middleware components, and how do they work in the ASP.NET Core request pipeline?
How do you configure dependency injection in .NET Core?
What is the difference between IConfiguration and IOptions in .NET Core?
How does the appsettings.json file work in .NET Core?
What is the significance of the Program.cs file in .NET Core applications?

𝐈𝐧𝐭𝐞𝐫𝐦𝐞𝐝𝐢𝐚𝐭𝐞:
8. What is Kestrel, and why is it used in .NET Core?
9. Explain the concept of routing in ASP.NET Core.
10. What is the purpose of ConfigureServices and Configure methods in the Startup class?
11. How does ASP.NET Core handle cross-origin resource sharing (CORS)?
12. What are the benefits of using Entity Framework Core in .NET Core applications?
13. Explain the role of the IHostedService interface in .NET Core and provide an example of how to implement it.
14. How does ASP.NET Core support asynchronous programming?

𝐀𝐝𝐯𝐚𝐧𝐜𝐞𝐝

15. How does the ASP.NET Core request processing pipeline work internally?
16. How would you design and implement a microservices architecture using ASP.NET Core?
17. What is the difference between IApplicationBuilder and IServiceCollection in .NET Core?
18. How can you implement centralized logging and monitoring in a .NET Core application?
19. Explain the difference between transient, scoped, and singleton lifetimes in dependency injection.
20. How would you implement health checks in an ASP.NET Core application?
21. What is the purpose of the BackgroundService class, and how does it relate to IHostedService?
22. How does the .NET Core Generic Host differ from the Web Host?
23. How would you handle global exception handling in ASP.NET Core?
24. What is the purpose of DataProtection in .NET Core, and how would you use it?
25. How can you configure and manage multiple environments in ASP.NET Core?



LinQ:

𝗟𝗜𝗡𝗤: 𝗘𝗦𝗦𝗘𝗡𝗧𝗜𝗔𝗟 𝗠𝗘𝗧𝗛𝗢𝗗𝗦 𝗙𝗢𝗥 𝗘𝗙𝗙𝗜𝗖𝗜𝗘𝗡𝗧 𝗤𝗨𝗘𝗥𝗜𝗘𝗦 𝗜𝗡 𝗖# 🚀

If you work with C#, mastering LINQ (Language Integrated Query) is a game-changer for writing cleaner and more efficient code. Here are some key LINQ methods you should know:

🔹 𝗪𝗵𝗲𝗿𝗲 → Filters elements based on a condition.
🔹 𝗦𝗲𝗹𝗲𝗰𝘁 → Projects or transforms elements into a new form.
🔹 𝗚𝗿𝗼𝘂𝗽𝗕𝘆 → Groups elements based on a specified key.
🔹 𝗢𝗿𝗱𝗲𝗿𝗕𝘆 → Sorts elements in ascending order.
🔹 𝗔𝗻𝘆 → Checks if any element satisfies a condition.
🔹 𝗔𝗹𝗹 → Verifies if all elements meet a condition.
🔹 𝗖𝗼𝘂𝗻𝘁 → Returns the number of elements.
🔹 𝗙𝗶𝗿𝘀𝘁 → Gets the first element (throws an exception if empty).
🔹 𝗙𝗶𝗿𝘀𝘁𝗢𝗿𝗗𝗲𝗳𝗮𝘂𝗹𝘁 → Gets the first element or a default value if empty.
🔹 𝗟𝗮𝘀𝘁 → Gets the last element (throws an exception if empty).
🔹 𝗗𝗶𝘀𝘁𝗶𝗻𝗰𝘁 → Removes duplicates from a sequence.
🔹 𝗧𝗮𝗸𝗲 → Retrieves a specified number of elements.
🔹 𝗦𝘂𝗺 / 𝗠𝗮𝘅 / 𝗠𝗶𝗻 / 𝗔𝘃𝗲𝗿𝗮𝗴𝗲 → Performs numeric calculations on a sequence.
🔹 𝗨𝗻𝗶𝗼𝗻 → Combines two sequences, returning unique elements.
🔹 𝗜𝗻𝘁𝗲𝗿𝘀𝗲𝗰𝘁 → Returns common elements between two sequences.
🔹 𝗘𝘅𝗰𝗲𝗽𝘁 → Returns elements in the first sequence that are not in the second.

No comments:

Post a Comment