Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Entity Framework - Entity Collection Refresh
Message
 
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01464069
Message ID:
01464580
Views:
61
>>>>>>>>I have a back end data store that is receiving frequent updates from another process. (Currently SQL Express 2005 but I don't want to tie myself to that.)
>>>>>>>>
>>>>>>>>I have one table of groups and another that is children of that group, some of the children are periodically moved from one group to another and sometimes new children are added.
>>>>>>>>
>>>>>>>>When I do a:
>>>>>>>>
>>>>>>>>MyContext.Refresh(RefreshMode.StoreWins, group.children);
>>>>>>>>
>>>>>>>>The child collection does not reflect any of the added children. Is there a way to get these child collections to fully refresh?
>>>>>>>
>>>>>>>OK... I got a little further:
>>>>>>>
>>>>>>>group.children.Load(MergeOption.OverwriteChanges);
>>>>>>>
>>>>>>>Does cause the children to refresh. Unfortunately... when it comes to the AssociationChanged Event:
>>>>>>>
>>>>>>>"Events may be suppressed during bulk operations, such as Load, Attach, and Clear."
>>>>>>>
>>>>>>>So I'm still searching for a way to update anything else that might need updating and I'm unsure how it will behave in WPF. (I'll have to test that.)
>>>>>>
>>>>>>Talking to myself again <g>
>>>>>>
>>>>>>The AssociationChanged event was getting called and it does work. My event hook up wasn't getting called.
>>>>>
>>>>>Glad it's working. I wondered whether "Events may be suppressed during bulk operations, such as Load, Attach, and Clear."
>>>>>should be taken literally:"Events may be suppressed during bulk operations, such as Load, Attach, and Clear."
>>>>> - i.e. implying the event would still fire *after* the load ?
>>>>
>>>>Ya... brain dead moment on my part. Wrote the code to hook up the events but I never called it. LOL Figured it out instantly when I saw that WPF was getting the events.
>>>>
>>>>Keeping local data in sync with the data store was one area that VFP really handled a lot better than .NET. Seems like I'm constatnly having fun with refreshes in .NET, but I learned a few tricks from this one that may help me out in the future.
>>>>
>>>>Discovering that I can call Load on an entity set that is already loaded (silly me assumed that once it was loaded it was loaded) may help a lot with my refresh woes. From another discusion it sounds like this can also work with execute, but I haven't tested that yet.
>>>
>>>I must admit to struggling somewhat with the Entity Framework on occasion. The changes in .NET 4 look useful but I haven't had time to play with them yet......
>>>
>>>My current favourite toy is the .NET 4 Tuple class !
>>
>>This is probably apropos of nothing but if I owned a software company you would be one of the first people I hired. Alas, I do not own a software company ;-)
>
>Thanks Mike. But s'alright *I* own a software company. But then again sometimes I think I should fire myself (g)
>
>>I did work for one very good one. Unless I get very lucky it will remain the best place I ever worked. It was called RDI Software when I joined, then changed its name to Geneer. Half the company were literally engineers and worked on machine controllers, very low level. It was developer nirvana. Every developer had the latest hardware and software. Every developer had an office with a door. At crunch time in projects "DND" post-its on doors were not unusual. There were sleeping bags in the supply closet and they got used. We didn't mind. We were the best east of the 111 and we knew it. We pulled off miracles. We were expected to and we did.
>>
>>This was in the era when full benefits were the norm. RDI/Geneer took that a step further. We had a fully stocked kitchen for free. It made business sense -- quick lunch at the desk instead of going out for an hour. The food budget was $18,000 a month. If you wanted something, within reason, all you had to do was send an email and there it was. It was kind of funny to come in early in the morning and see the younguns -- I was in my mid 30s at the time, a senior citizen by company standards -- chowing down on Cap'n Crunch and Sugar Pops.
>
>That sounds like it was fun. How many employees were there with the company at that time? I've done contract work for companies of all sizes and, as a general rule, I found that the sense of fun and enthusiasm was pretty much inversely proportional to company size. I don't think I've ever really enjoyed working for a company (at least a software house company) with more than say a dozen employees....
>
>>

We peaked at around 150. It was an incredibly cool place to work. I was not bad and I worked with people better than me every day. Some people would be threatened by that. I wasn't. It was exhilirating. It's fun flying with the eagles.

.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform