tareqimbasher / NetPad

A cross-platform C# editor and playground.
MIT License
1.36k stars 68 forks source link

Netpad equivalent of "SubmitChanges()"? #68

Closed reedperkins closed 1 year ago

reedperkins commented 1 year ago

Hi @tareqimbasher !

I am so happy I stumbled across NetPad recently. Since moving to Linux, I've dearly missed LINQPad, and your re-implementation makes me feel less homesick :)

I have a dumb question -- what is the equivalent of the global SubmitChanges() in NetPad? How do I save changes after I've made modifications to an entity? There doesn't seem to be a global DbContext instance that I can access.

Thanks again for making this amazing software!

tareqimbasher commented 1 year ago

Hi @reedperkins,

I'm very glad you're enjoying it! Working on Linux/Mac and still being able to have access to a tool like this is one of the main reasons I developed NetPad.

NetPad uses EF core internally, so its SaveChanges(). You can also directly access the DbContext instance with the DataContext property.

Welcome to NetPad, excited to have you as a user! Consider starring the repo ⭐

tareqimbasher commented 1 year ago

Closing this issue. Feel free to reopen it if you have any related questions.