Why to use Dependency Injection?

  Рет қаралды 30,826

Interview Happy

Interview Happy

Күн бұрын

Пікірлер: 24
@nehalsingh785
@nehalsingh785 2 ай бұрын
Awesome Explanation Sir
@rkumartiwari1496
@rkumartiwari1496 Жыл бұрын
After watching this video i am happy 😊
@quranandsoul1375
@quranandsoul1375 10 ай бұрын
Sir please make a detailed video on TYPES OF DEPENDENCY INJECTION
@theparagbagga
@theparagbagga 9 ай бұрын
Happy bhai iski next video kahan hai
@sitaramthirumalasetty9205
@sitaramthirumalasetty9205 2 жыл бұрын
Can i have the video link of how to implement dependency injection in controller
@easy_cook_food
@easy_cook_food 2 ай бұрын
I am also looking for it, Did you get it sir ?
@ScitechExplorerEnglish
@ScitechExplorerEnglish 2 жыл бұрын
Sir can you make a video on upcasting and downcasting of base - derived types in c#....and why there is need for upcasting and downcasting
@interviewhappy
@interviewhappy 2 жыл бұрын
Soon I will add some more interview questions.
@theekshanmi3472
@theekshanmi3472 Жыл бұрын
Could you please give the Detailed explanation of dependency injection concept in C# with examples in real-time senarios.
@sourabhsalve8290
@sourabhsalve8290 Жыл бұрын
Will u please explain - if we change method signature then do we need to change code in each and every controller? or for this type of change there is another solution. And in this type of situation how we can say it is loosely coupled?
@interviewhappy
@interviewhappy Жыл бұрын
Yes we have change. We have some limitations in this loosely coupled way.
@techwithchanchal
@techwithchanchal Жыл бұрын
I can't find the next video anywhere. could somebody please share ?
@jinupg6559
@jinupg6559 5 ай бұрын
Can i have the video link of how to implement DI in controller
@easy_cook_food
@easy_cook_food 2 ай бұрын
I am also looking for it, Did you get it sir?
@shardendumishra6229
@shardendumishra6229 2 жыл бұрын
How to block multiple login with same credentials in different browsers and in different devices
@interviewhappy
@interviewhappy 2 жыл бұрын
We can maintain some flag at server side, whether the user is active or not. Session is a traditional way but their can be other approaches.
@lgiorgos1
@lgiorgos1 Жыл бұрын
I guess instead of DI I could use public static methods. Why wouldn't I do that instead of DI?
@mahek2001
@mahek2001 Жыл бұрын
Static methods are difficult to test and mock , that's why its avoided.
@ashishkumarsaini593
@ashishkumarsaini593 3 ай бұрын
Hi @Happy, please share full videos or else don't explain at all. Don't be commercial like others. Share information with good will and you'll get more than you expect.
@karpagamm7169
@karpagamm7169 Жыл бұрын
Int num1 = 20; int num2 = 30; num1 ^= num2 ^= num1 ^= num2; Console.Writeline(num1 + " , " + num2); Ans : 0,20.. kindly explain this code sir..
@mayankpriyadarshi9346
@mayankpriyadarshi9346 5 ай бұрын
The code you've posted uses a series of bitwise XOR operations to swap the values of `num1` and `num2`. However, it looks like the result you mentioned, "0, 20," might be incorrect. The correct result of the swap operation using XOR should be "30, 20." Let's break down how it works: ### Initial Values: - `num1 = 20` (binary: `10100`) - `num2 = 30` (binary: `11110`) ### Operations: 1. `num1 ^= num2` - `num1 = num1 ^ num2` - `num1 = 20 ^ 30` - `num1 = 10100 ^ 11110` - `num1 = 01010` (which is 10 in decimal) 2. `num2 ^= num1` - `num2 = num2 ^ num1` - `num2 = 30 ^ 10` - `num2 = 11110 ^ 01010` - `num2 = 10100` (which is 20 in decimal) 3. `num1 ^= num2` - `num1 = num1 ^ num2` - `num1 = 10 ^ 20` - `num1 = 01010 ^ 10100` - `num1 = 11110` (which is 30 in decimal) ### Final Values: - `num1 = 30` - `num2 = 20` ### Code: ```csharp int num1 = 20; int num2 = 30; num1 ^= num2; // Step 1: num1 becomes 10 (01010) num2 ^= num1; // Step 2: num2 becomes 20 (10100) num1 ^= num2; // Step 3: num1 becomes 30 (11110) Console.WriteLine(num1 + " , " + num2); // Output: 30 , 20 ``` ### Explanation: 1. **First XOR (`num1 ^= num2`)**: - `num1 = num1 ^ num2` changes `num1` to `10` (binary `01010`). 2. **Second XOR (`num2 ^= num1`)**: - `num2 = num2 ^ num1` changes `num2` to `20` (binary `10100`). 3. **Third XOR (`num1 ^= num2`)**: - `num1 = num1 ^ num2` changes `num1` to `30` (binary `11110`). Thus, after the XOR swap sequence, `num1` becomes 30 and `num2` becomes 20, which is the intended result. If the output you see is "0, 20," there might be an error in the implementation or a different problem in the environment where the code is run. The correct output for this code should be "30, 20."
@navalkish
@navalkish Жыл бұрын
Sorry to say but in all your videos, you are leaving the people in question mode. Try to complete things in a single video.
@interviewhappy
@interviewhappy Жыл бұрын
sure
@shrujankmr
@shrujankmr Жыл бұрын
sir it cover only 50% of the solution..
SOLID  Principal - Interview Questions and Answers
24:04
Interview Happy
Рет қаралды 126 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 6 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 54 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 43 МЛН
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 28 МЛН
ASP NET Core dependency injection tutorial
9:28
kudvenkat
Рет қаралды 430 М.
IEnumerable, IEnumerator, IQueryable in C# .NET
6:13
Interview Happy
Рет қаралды 53 М.
Explain Generics in C#? When and why to use them in real applications?
5:57
LINQ in C# .NET
6:49
Interview Happy
Рет қаралды 48 М.
What is Dependency Injection in .NET?
7:31
DotNetMastery
Рет қаралды 28 М.
What is Dependency Injection?
4:04
Interview Happy
Рет қаралды 67 М.
What is the role of Startup.cs file?
6:42
Interview Happy
Рет қаралды 31 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 6 МЛН