Harpreet Kaur is a skilled Full Stack Developer with 5.7 years of experience specializing in both front-end and back-end development using the .NET Framework, .NET Core, C#, MVC, LINQ, REST APIs, SQL, and JavaScript, along with one year of expertise in Angular. Throughout her career, she has built and maintained complex applications in industries like health insurance and contributed to innovation through POCs and API integrations. She thrives in Agile environments, where she has taken on leadership roles, guided teammates, and earned recognition for her technical achievements.
IT Analyst
Tata Consultancy ServicesTechnology Analyst
InfosysASP.NET
C#
MVC
Microsoft SQL Server
HTML
TFS
DevOps
Git
Web API
Web Services
SSIS
Entity Framework
Visual Studio Code
Hello, everyone. I am Harpreet Kaur, and, uh, I'm from Jalandhar, Punjab, and currently have experience of 5.7 years of experience in technology, uh, which includes csharp, uh, dotnetcore.netcore, uh, 6 and 8, then MVC, uh, structure, uh, web APIs, rest APIs. So, currently, I was working in DCS, but I left due to some personal commitments. I left TCS on June 14, 2024, and now I'm looking for a remote opportunity. So while working in TCS, I was part of NBS, that is nationwide building society project, which is a, uh, banking project, uh, that main mainly deals with member's data, their health insurance policies, loans. So we will work there. I work there in agile methodology. And csharp.net, uh, were my main core technologies to work there. Then I have completed my graduation from Punjab University Chandigarh. After that, I completed my masters of computer applications, um, that also from Punjab University Chandigarh, and then I got placed from campus in Infosys. And now I worked there in Infosys for 4 years. After that, I switched to TCS. And in TCS, I worked for one and half year. And due to some remote, uh, I actually needed, uh, to walk remotely that's why I left TCS.
Uh, implement a real time communication in a dot net core application. Uh, we can use web APIs, uh, to communicate between different applications as we already, uh, know that, uh, we don't need to connect our project to database, uh, when we are consuming web APIs. So we can develop our web APIs using, uh, Angular sorry. Using c sharp web API project, then, uh, implement all the APIs, uh, which can be, uh, HTTP put, get, and post, or delete. So after implementing, uh, the these can be, uh, asynchronously implemented. So we don't, uh, by implementing asynchronously means that we don't need to, uh, wait for one task to complete. So it will, uh, work on concurrently. So that's why we have used async for implementing web APIs. So after, uh, implementing these test APIs, we can, uh, consume it using any, uh, front end, like, type, uh, for a front end or some other platforms like Angular or using in Visual Studio Code or Visual Studio, and then we can consume these APIs. So because of this, we don't need to directly connect with database to store our data. Uh, we can just implement those. We can just consume those rest APIs. Uh, This is how, uh, real time communication can also happen. Uh, there is one more way we can use Ajax calls for, uh, without using Ajax calls. We we can load our page without even reloading full content of that page.
Custom exceptions. So in using, uh, we can, uh, create our own exception handling using custom exceptions. So we can, uh, we can implement our code, uh, according to our requirement. That is why we have exception, uh, custom exceptions. That means we can mold her, uh, code according to our requirement. So c sharp provide a way to implement custom exceptions. What we can do, the main benefit of using custom custom exception is that, uh, we can implement our own business logic whenever there is an exception occurred in our application. So so suppose we have we are running an application and an exception has occurred and we don't know where is this exception. So we can, uh, implement custom exception class. We can create a class. Uh, we can name it as custom exception, then implement the functionality, like, whether, uh, there is any exception occurred at any point of our application, then we need to uh, raise this particular page or we can render this particular view. So whenever that exception has occurred. We have some built in exceptions in c sharp, uh, like, divide by 0 or some 4 not 4. These these are the built in exception. So other than that, if there are, we need to, uh, handle exception according to a developer's, uh, perspective, then we can use custom custom exception. So we can implement our own logic, business logic into that exception and then throw that exception whenever an application has stuck somewhere in between. So, uh, there are other exception other benefits also by using custom exception is that we we don't need to stick to the existing exception handling functions. So we can, uh, develop our own exception handling code.
In c sharp, which solid principle do extension methods most closely adhere to n y? Uh, in open closed relationship, In open close relationship, uh, extension methods are most closely adhered to. Uh, by using open closed relationship means that, uh, any class should be open for implementing any new feature, and it is it should be closed for any modification if the application is already built and it has gone through all the unit test cases, and we now we are changing our requirement. We are doing some changes in our code that means, uh, it should not be done like that. So by using open, uh, for example, we have a class called, uh, it and it is calculating area of a rectangle. So we are done with our code, and there is another requirement and we need to calculate area of, uh, circle also. And then again, we are making changes in our this code that is, uh, calculate area, this class, then this is piloting a closed relationship. It means, uh, we have already done our coding and go through the UAT, but we are again changing this due to this requirement. So rather than that, we what we can do is we can create one interface and declare a method there like calculated area. So whenever there is a new requirement of calculating area of a rectangle or circle or triangle, any shape, then we can just need to, uh, change that method, not the full class. So the open close relationship is the one of the most important relationship in solid principal.
Explain how would you enable course origin request in a dotnetcorestapi. For enabling course course, uh, we can, uh, enable COS by using different ways. The first one is, uh, using a attribute upon a action method that can be, uh, enable course. And enable course, uh, will help us to, uh, we can, uh, mention the policy name in that parenthesis by using enable course attribute. This is this is the first way we can, uh, enable course. Second way is using, uh, use course app dot there is 1, uh, use course middleware. Uh, by using that middleware, also, we can, uh, enable course in this. What we can do is, uh, we can use app dot use course middleware and then mention the policy name in it. And we can use the lambda expression like options. There are multiple options for, uh, like, with same origin. With same origin means only this domain should be, uh, accessed by using if you're using that course for that domain, then with any method means any method can be accessed. We have another option, like, with any headers, any headers can be accessed. So this is the second way we can enable course. And this is this was using middleware use, uh, app dot use middleware. Sorry. Use course. Then we have add course. There is one more, uh, way to implement, uh, enable course that is add course. Services dot add course, we, uh, there is one method we can use. And in this method, we can create our own policy name, uh, mention the policy name and then its options using lambda expression. So this can be again, uh, with same origin. Then we have other option, like, uh, with any method with any headers. So these are the options that we can include in our course properties.
Mention a scenario where you would use an async method in c sharp to improve API performance. Yes. To using async method. Yes. Uh, we can for example, we are creating a student repository. And first of all, we are creating 1 interface, and it will contain all the generic methods. These generic methods are async methods. So we will use async keyword before declaring a method, then it type as, um, return type can be t of type, then that suppose the name of the method is get. So it will return all the list of students asynchronously. So we have declared this method in our interface, then we will create a class. For example, the class name is repository class. In this repository class, we will implement our in async interface method here. So the method name will be async, uh, the name of the method, and then we will implement we'll connect this to database using for example, we have a application DB context for connecting to database, and we will get the list of students from our database using, uh, DBContext dot, uh, we can use any method like find or, uh, first or default. This method can be used, and we need to use the await keyword in front of calling a sync method that is a inbuilt sync method. Uh, we can have a list async. List list it will return list async. So this method will return, uh, data from our database. So this is how we can use async. So we need to use await keyword before calling any async built in method or implementing a async method.
Look at this code. How would you debug the issue that arises when you try to update an existing item in the Actually, here, we are using, okay, item dot. How would you debug the issue that arises when you try to update an item? So first of all, we will put the debug point, uh, in the method update item. For example, we are you if we are using Postman for, uh, testing this API, and then we are giving item as in the body of, uh, API calling. And and the type of the method is HTTP port. So I think, uh, that uh, attribute is also missing here, HTTP port. We need to place it just well, actually, this is the, uh, actually, this is the repository, and, uh, we we don't need a attribute as to to be put here. Uh, so where existing item equals to item dot first or default. We are already assigning item in existing item, uh, variable. So we don't need to assign again it in existing item is equal to item. As we we got the existing item here, so what we will do We need to save also.
Given this issue, I was looking to identify the solid principle that might be violated here and explain why. Class report printer, print report, generating report, public format report. Actually, this is, uh, violating the first principle of Solid that is single responsibility principle. Uh, it means whenever we are creating classes, it should have a single responsibility. It should not uh, perform multiple tasks. For example, here, we have a class report printer. So in this report printer class, we are, uh, we are using 2 methods, print report and format report. So we are performing performing more than one task in this class. Like, we are generating reports also. We are formatting report also. So for these two methods, we should have another classes like, uh, generate report or, uh, the format report. And in these classes, we can implement our functionality, like how to, uh, format a class, how to format a report or how to generate a report. And then, uh, we can, uh, implement these classes, or we can use the methods of these classes. We can use the methods of those classes in our report printer class. So it is violating the first principle, uh, that is single responsibility principle.
How can a dot net core application be made more secure against SQL injection attacks? To make application more secure using SQL injection attacks, we can use we can, uh, implement stored procedures, uh, instead of directly using, uh, select or insert statements into our c sharp dot dot core. So instead, we can, uh, you might create multiple stored procedures. And so we can just, uh, using stored procedure, we can, uh, uh, implement or insert or delete or some select statements to fetch the data. Other than that, we can also use, uh, normalizations. I not table that table should be in all three normalized forms. Then we can use indexes, then try catch blocks in our stored procedures. Uh, or so we we can also use Windows authentication or, uh, SQL Server authentication for, uh, connecting to the database. So other than that, uh, so these things we can use.
What is the role of configure await method in using programming with C Sharp? Configure await method. It's a asynchronous method in a sec, in c sharp. It will configure our configuration items asynchronously.
Again, did you integrate signal, uh, with, uh, dot net core application for real time, Shubhrant?