Q16. When to use Property Dependency Injection over Constructor Injection and vice versa?
Q17. What is the relation between IOC, DIP, DI and IOC Container?
Q18. What are different types of IOC inversion of control Container?
Q19. What is JWT web token? Tell some features of JWT token?
Q20. I have an api which is capable of returning both xml and json data. From your client how you request so that data comes in XML format?
--------------------------------------------------------------------------------------------------------------------------
Q16. When to use Property Dependency Injection over Constructor Injection and vice versa?
Answer:
https://www.tutorialsteacher.com/ioc/introduction
--------------------------------------------------------------------------------------------------------------------------
Q19. What is JWT web token? Tell some features of JWT token?
Answer:
Q20. I have an api which is capable of returning both xml and json data. From your client how you request so that data comes in XML format?
Answer:
If our service need to support both the formats (XML/ JSON) then we need to add code in WebApiConfig.cs file. In order to accomplish above requirement, we will force the user to send us information what type format they need.
http://localhost:1312/api/Blog?type=xml
http://localhost:1312/api/Blog?type=json
Search for text - "Send result in different formats like XML, JSON" in below url
https://www.c-sharpcorner.com/UploadFile/manas1/introduction-to-Asp-Net-webapi-and-returns-result-in-differe/
--------------------------------------------------------------------------------------------------------------------------
Q17. What is the relation between IOC, DIP, DI and IOC Container?
Q18. What are different types of IOC inversion of control Container?
Q19. What is JWT web token? Tell some features of JWT token?
Q20. I have an api which is capable of returning both xml and json data. From your client how you request so that data comes in XML format?
--------------------------------------------------------------------------------------------------------------------------
Q16. When to use Property Dependency Injection over Constructor Injection and vice versa?
Answer:
The Constructor Dependency Injection in C# is the standard for dependency injection. It ensures that all the dependency objects are initialized before we are going to invoke any methods or properties of the dependency object, as a result, it avoids the null reference exceptions.
The Setter/Property Dependency Injection in C# is rarely used in real-time applications. For example, if I have a class that has several methods but those methods do not depend on any other objects. Now I need to create a new method within the same class but that new method now depends on another object. If we use the constructor dependency injection here, then we need to change all the existing constructor calls where we created this class object. This can be a very difficult task if the project is a big one. Hence, in such scenarios, the Setter or Property Dependency Injection can be a good choice.
--------------------------------------------------------------------------------------------------------------------------
Q17. What is the relation between IOC, DIP, DI and IOC Container?
Answer:

IoC and DIP are high level design principles which should be used while designing application classes. As they are principles, they recommend certain best practices but do not provide any specific implementation details. Dependency Injection (DI) is a pattern and IoC container is a framework.Q17. What is the relation between IOC, DIP, DI and IOC Container?
Answer:

https://www.tutorialsteacher.com/ioc/introduction
--------------------------------------------------------------------------------------------------------------------------
Q18. What are different types of IOC inversion of control Container?
Answer:
There are a lot of Dependency Injection Containers are available in the market which implements the dependency injection design pattern. Some of the commonly used Dependency Injection Containers are as follows.
Answer:
There are a lot of Dependency Injection Containers are available in the market which implements the dependency injection design pattern. Some of the commonly used Dependency Injection Containers are as follows.
- Unity
- nInject
- Castle Windsor
- StructureMap
- Spring.NET
Q19. What is JWT web token? Tell some features of JWT token?
Answer:
- JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object
- Authorization: This is the most common scenario for using JWT. Once the user is logged in, each subsequent request will include the JWT, allowing the user to access routes, services, and resources that are permitted with that token
- Single Sign On is a feature that widely uses JWT nowadays, because of its small overhead and its ability to be easily used across different domains.
Q20. I have an api which is capable of returning both xml and json data. From your client how you request so that data comes in XML format?
Answer:
If our service need to support both the formats (XML/ JSON) then we need to add code in WebApiConfig.cs file. In order to accomplish above requirement, we will force the user to send us information what type format they need.
http://localhost:1312/api/Blog?type=xml
http://localhost:1312/api/Blog?type=json
Search for text - "Send result in different formats like XML, JSON" in below url
https://www.c-sharpcorner.com/UploadFile/manas1/introduction-to-Asp-Net-webapi-and-returns-result-in-differe/
--------------------------------------------------------------------------------------------------------------------------

No comments:
Post a Comment