Junior — Middle
Do you have experience working with libraries for extracting data from databases?
sobes.tech AI
Answer from AI
Yes, in C# libraries for working with databases are often used, such as ADO.NET, Entity Framework, Dapper, and others.
- ADO.NET — low-level access to data via SQL queries and commands.
- Entity Framework — ORM that allows working with the database through objects and LINQ queries.
- Dapper — a lightweight ORM that provides fast mapping of SQL query results to objects.
Example of using Entity Framework to retrieve data:
using(var context = new MyDbContext()) {
var users = context.Users.Where(u => u.IsActive).ToList();
}
Here, we get a list of active users from the database using a LINQ query to the database context.