using (FooEntities entities = new FooEntities()) { var result = (from p in entities.Bar where p.IdBar.Equals(1001) select p); System.Diagnostics.Trace.Write(string.Format("SQL: {0}", ((System.Data.Objects.ObjectQuery)result).ToTraceString())); }Esto nos devolverá en nuestra ventana de Resultados lo siguiente
SQL: SELECT [Extent1].[IdBar] AS [IdBar], [Extent1].[BarDesc] AS [BarDesc], [Extent1].[Valor] AS [Valor], [Extent1].[FC] AS [FC], [Extent1].[UC] AS [UC] FROM [dbo].[Bar] AS [Extent1] WHERE 1001 = [Extent1].[IdBar]Algo bastante simple que nos puede ayudar bastante en algún momento.
Happy coding!
No hay comentarios:
Publicar un comentario