Questions et réponses d'entretien les plus demandées et tests en ligne
Plateforme d'apprentissage pour la preparation aux entretiens, les tests en ligne, les tutoriels et la pratique en direct

Developpez vos competences grace a des parcours cibles, des tests blancs et un contenu pret pour l'entretien.

WithoutBook rassemble des questions d'entretien par sujet, des tests pratiques en ligne, des tutoriels et des guides de comparaison dans un espace d'apprentissage reactif.

Preparation a l'entretien

Entity Framework Questions et reponses d'entretien

Question 16. What is the purpose of the DatabaseGenerated attribute in Entity Framework?

The DatabaseGenerated attribute is used to configure how values for a property are generated by the database when inserting a new record.

Example:

[DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; }

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 17. Explain the purpose of the InverseProperty attribute in Entity Framework.

The InverseProperty attribute is used to specify the inverse navigation property in a relationship when the default convention is not followed.

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 18. What is the purpose of the ExecuteSqlCommand method in Entity Framework?

The ExecuteSqlCommand method is used to execute a SQL command that does not return any results, such as an UPDATE or DELETE statement.

Example:

context.Database.ExecuteSqlCommand("UPDATE MyTable SET Column1 = 1 WHERE Id = 1");

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 19. Explain the purpose of the Database.Log property in Entity Framework.

The Database.Log property is used to log SQL statements and other information related to database operations. It can be useful for debugging and performance tuning.

Example:

context.Database.Log = Console.WriteLine;

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Question 20. What is the purpose of the [Table] attribute in Entity Framework?

The [Table] attribute is used to specify the table name for an entity when it does not match the default convention.

Example:

[Table("MyCustomTableName")] public class MyEntity { /* properties */ }

Est-ce utile ? Ajouter un commentaire Voir les commentaires
 

Les plus utiles selon les utilisateurs :

Copyright © 2026, WithoutBook.