Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to let Entityframework-Extensions log out sql statement executed #35

Closed
alexander9999 opened this issue Apr 26, 2017 · 4 comments
Closed
Assignees

Comments

@alexander9999
Copy link

@JonathanMagnan ,

i use the Bulk delete method, and that functions good, is it possible that the generated SQL Statement for the bulk Operation is Outputted. i have tried to use following code:
MyContext.Database.Log = Console.Write;
but i could see nothing.

thanks

@JonathanMagnan
Copy link
Member

Hello @alexander9999 ,

Our library has his own logger. You can find an example here: http://entityframework-extensions.net/log

StringBuilder logger = new StringBuilder();
using (var ctx = new EntitiesContext())
{
    ctx.BulkSaveChanges(operation =>
    {
        operation.Log += s => logger.AppendLine(s);
    });
}

Let me know if that helped you or you need more information.

Best Regards,

Jonathan

@JonathanMagnan JonathanMagnan self-assigned this Apr 26, 2017
@alexander9999
Copy link
Author

Hello @JonathanMagnan ,

sorry, late to reply.
one another question to entityframework.plus, has it also the same or similar usage?

thanks,

@JonathanMagnan
Copy link
Member

Hello @alexander9999 ,

No, Entity Framework Plus has no logger features but that might may a good idea to add in the future.

I added this request to our list.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @alexander9999 ,

I will close this request since I believe I have answered your question and the asking features are about EF+.

Feel free to re-open it if something is missing.

Best Regards,

Jonathan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants