Junior — Middle
Have you had experience developing or configuring databases in your projects?
sobes.tech AI
Answer from AI
Yes, working with databases is common in C# projects. Usually, Entity Framework (EF) — a Microsoft ORM — is used, which allows working with a database through objects.
Experience may include:
- Designing data models as C# classes.
- Configuring the database context (DbContext).
- Performing migrations to change the database structure.
- Writing LINQ queries for data retrieval and modification.
- Optimizing queries and working with transactions.
An example of a simple model class and context:
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
}
public class AppDbContext : DbContext
{
public DbSet<Product> Products { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlServer("your_connection_string");
}
This approach simplifies working with the database and integrating data into the application.