Practicing and exploring
Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring this chapter’s topics with deeper research.
Exercise 2.1 – Test your knowledge
Answer the following questions:
- Which NuGet package should you reference in a .NET project to get the best performance when working with data in SQL Server?
- What is the safest way to define a database connection string?
- What must T-SQL parameters and variables be prefixed with?
- What must you do before reading an output parameter?
- What type does Dapper add its extension methods to?
- What are the two most commonly used extension methods provided by Dapper?
Exercise 2.2 – Explore topics
Use the links on the following page to learn more details about the topics covered in this chapter:
Exercise 2.3 – Alternatives for storing secrets
Secrets like passwords and other values used in database connection strings, or values like keys to access a service, are often stored in environment variables. Other places for storing these values include App Secrets. You can learn more about them in the article Safe storage of app secrets in development in ASP.NET Core, found at the following link:
https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets
For related guidance about handling connection strings, you can read the following link:
https://learn.microsoft.com/en-us/ef/core/miscellaneous/connection-strings