JohnPapa.net: All Commentshttp://johnpapa.net/Musings from a .NET AddictGraffiti CMS 1.0 (build 1.0.1.963)Fri, 04 Jul 2008 21:14:00 GMTRE: Why Use the Entity Framework?http://johnpapa.net/all/why-use-the-entity-framework/#comment-871Fri, 04 Jul 2008 21:14:00 GMThttp://johnpapa.net/all/why-use-the-entity-framework/#comment-871Emir Trevi&#241;o<p>Hi John, what is your opinio about this tool:</p> <p> <a target="_blank" href="http://www.codeplex.com/sfs/">http://www.codeplex.com/sfs/</a> </p> <p>thanks</p> RE: Using the Entity Framework in a Layered Architecturehttp://johnpapa.net/all/using-the-entity-framework-in-a-layered-architecture/#comment-870Fri, 04 Jul 2008 21:07:00 GMThttp://johnpapa.net/all/using-the-entity-framework-in-a-layered-architecture/#comment-870Dew Drop - July 4, 2008 | Alvin Ashcraft's Morning Dew<p>Pingback from Dew Drop - July 4, 2008 | Alvin Ashcraft's Morning Dew</p> <br /> Trackback url: http://www.alvinashcraft.com/2008/07/04/dew-drop-july-4-2008/RE: Tutorial: Create a Silverlight 2 User Control from a Popup Controlhttp://johnpapa.net/all/tutorial-create-a-silverlight-2-user-control-from-a-popup-control/#comment-869Thu, 03 Jul 2008 04:31:00 GMThttp://johnpapa.net/all/tutorial-create-a-silverlight-2-user-control-from-a-popup-control/#comment-869Tutorial: Create a Silverlight 2 User Control from a Popup Control<p>Pingback from Tutorial: Create a Silverlight 2 User Control from a Popup Control</p> <br /> Trackback url: http://2x.morelyrics.co.uk/2008/06/19/tutorial-create-a-silverlight-2-user-control-from-a-popup-control/RE: 6 Great Tools For Writing a Bookhttp://johnpapa.net/all/6-great-tools-for-writing-a-book/#comment-868Mon, 30 Jun 2008 02:52:00 GMThttp://johnpapa.net/all/6-great-tools-for-writing-a-book/#comment-868My Book Has a Life of its Own<p>I set out to write a book on data access, services, and Silverlight 2 and stick to those topics faithfully. I have a sticky note on my desk that shows the main topics and the word “thin” as a reminder to myself to stick to the point and keep the book</p> <br /> Trackback url: http://johnpapa.net/all/my-book-has-a-life-of-its-own/RE: As it Once Was, I am Writing a Bookhttp://johnpapa.net/all/as-it-once-was-i-am-writing-a-book/#comment-867Mon, 30 Jun 2008 02:52:00 GMThttp://johnpapa.net/all/as-it-once-was-i-am-writing-a-book/#comment-867My Book Has a Life of its Own<p>I set out to write a book on data access, services, and Silverlight 2 and stick to those topics faithfully. I have a sticky note on my desk that shows the main topics and the word “thin” as a reminder to myself to stick to the point and keep the book</p> <br /> Trackback url: http://johnpapa.net/all/my-book-has-a-life-of-its-own/RE: Entity Framework & LINQ Tonight in Sarasotahttp://johnpapa.net/all/entity-framework-amp-linq-tonight-in-sarasota/#comment-866Sun, 29 Jun 2008 18:46:00 GMThttp://johnpapa.net/all/entity-framework-amp-linq-tonight-in-sarasota/#comment-866the community foundation of sarasota county<p>Pingback from the community foundation of sarasota county</p> <br /> Trackback url: http://johnpaul.greatestluststories.com/thecommunityfoundationofsarasotacounty.htmlRE: Refactoring a PropertyChanged Event Handlerhttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-864Fri, 27 Jun 2008 22:27:00 GMThttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-864John Papa<p>I agree that in this case I would not use partial methods. Not when there are alternatives like a base class method. But its an idea I had not thought of.</p> RE: Refactoring a PropertyChanged Event Handlerhttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-863Fri, 27 Jun 2008 16:46:00 GMThttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-863Jonas<p>At first I also thought that partial methods was too smelly, but if you think about it, you don't have to have a partial method for each property. You can have one partial method: OnPropertyChanging or OnPropertyChanged and just call that method on every setter of each property passing in both the propertyname and the value. In that case it wouldn't required a lot of code and thus no need for autogenerated code.</p> <p>Performance wise I'm not sure which way is better.</p> RE: Refactoring a PropertyChanged Event Handlerhttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-862Fri, 27 Jun 2008 08:43:00 GMThttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-862Neil Mosafi<p>Oooh I wouldn't use Partial Methods for anything which wasn't codegen'd it's way too smelly!</p> <p>Anyway another option I can point out is to declare the event as</p> <p>public event PropertyChangedEventHandler PropertyChanged = delegate {};</p> <p>Then you don't need to worry about checking for null etc because the event cannot be null. Performance hit is pretty minimal for this and you also don't have to worry about concurrency issues etc (which your base class wasn't taking care of).</p> <p>Also Seb came up with a good way of doing it using DynamicProxy2 which i thought was very cool and even allows you to use it with automatic properties - <a target="_blank" href="http://serialseb.blogspot.com/2008/05/implementing-inotifypropertychanged.html">serialseb.blogspot.com/.../implementing-in</a> </p> RE: Refactoring a PropertyChanged Event Handlerhttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-861Thu, 26 Jun 2008 20:11:00 GMThttp://johnpapa.net/all/refactoring-a-propertychanged-event-handler/#comment-861Jonas<p>You can use the new partial methods. LINQ to SQL uses them everywhere.</p> <p>partial void OnUserIDChanging(int value);</p> <p> partial void OnUserIDChanged();</p> <p>public int UserID</p> <p> {</p> <p> get</p> <p> {</p> <p> return this._UserID;</p> <p> }</p> <p> set</p> <p> {</p> <p> if ((this._UserID != value))</p> <p> {</p> <p> this.OnUserIDChanging(value);</p> <p> this.SendPropertyChanging();</p> <p> this._UserID = value;</p> <p> this.SendPropertyChanged(&quot;UserID&quot;);</p> <p> this.OnUserIDChanged();</p> <p> }</p> <p> }</p> <p> }</p> <p>The SendPropertyChanging method raises the event just like you are doing.</p>