0

I want to ask how can I clear context if user want to go back in many cases? For example:

                _client.Invoice.Add(_invoice);
                _context.Client.Add(_client);

I bind and add Invoice and Client information but do not save it in database by using

_context.SaveChanges();

In this case the data still exist in context, What I want to ask about, How can I clear Invoice and Client context without leave window ?

Hope this is clear?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
YoMo
  • 43
  • 2
  • 8
  • 1
    What is the type of `_context`? – klugerama Jan 11 '14 at 00:15
  • 1
    Are you talking about Entity Framwork? – Kamolas81 Jan 11 '14 at 00:30
  • refer to following question if `_context` is linq to sql's DataContext : [How can I reject all changes in a Linq to SQL's DataContext?](http://stackoverflow.com/questions/259219/how-can-i-reject-all-changes-in-a-linq-to-sqls-datacontext). Otherwise you need to explain more about *context*, what kind of context? – har07 Jan 11 '14 at 00:58
  • I came here because this was tagged WPF, but I don't see the connection to WPF - is this tag right? – J Trana Jan 11 '14 at 02:37

0 Answers0