Do the following in your context
:
public DatabaseContext() : base("MeuContext")
{
//Trecho abaixo utilizado para ver as querys geradas pelo Entity
#if DEBUG
Database.Log = s => System.Diagnostics.Debug.WriteLine(s);
#endif
}
That stretch System.Diagnostics.Debug.WriteLine(s)
will cause all query
generated appear in Output when you are debugging.
The answer that uses the IQueryable
is also valid, but it is generally better to use it the way I have presented it here, because you want to check how your query was during the development and maintenance of the application to ensure that you are bringing the information correctly.
Of course this does not take away the validity of the option using IQueryble
and depending on what you want it can be more useful.
What is the database?
– novic
@Virgilionovic oracle bank
– Harry
@itasouza are you using
Entity Framework
?– Tiedt Tech
@Virgilionovic yes
– Harry