Is it possible to get SubmitChanges() to work from within an extension method?
I currently have this:
void Main()
{
// Write code to test your extensions here. Press F5 to compile and run.
Helper.ConfirmSubmitChanges();
}
public static class Helper
{
// Write custom extension methods here. They will be available to all queries.
public static void ConfirmSubmitChanges()
{
if (MessageBox.Show("Save?", "Do you really want to save all changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
SubmitChanges();
}
}
}
// You can also define non-static classes, enums, etc.
But SubmitChanges() is out of context here. Is there anything that i can pass it from my queries that will use this extension to make it work?
Thanks, Kohan