Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Add Logic to Interfaces using Extension Methods
travislaborde
follow
0
10-11-2007 8:38 AM
467 views
tags:
programming
,
.net
,
2008
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Related Clips
Do You Have TiVo Guilt? You're Not Alone
Alpha Sensory
Fake TV News Widespread and Undisclosed
The Age of Thinking, Self-Developing Robot...
Alan Colmes to Depart Top Rated Hannity & ...
Immersive Data Exploration
Sean Hannity Losing Colmes
More clips from
travislaborde
THE SPOILED UNDER-30 CROWD!!!
40 Wallpapers Loaded With Color
Wallpaper: Elemental
Today's Top Clips
Joint Chiefs Planned Terror Attacks in U.S A...!
19 Ways to Enhance Your Sense of Humor
Denmark's Kinder, Gentler System of Eugenics
Christmas Colors for the White House: Red, White and Impeach
Mothers 'Killed Sons to End War'
To see our behavior from different perspective
Where are all the Acorns?
A New Picture
Antarctic peninsula marine life
He's Not Black
visit the
Top Clips page
View the Top Clips from
October 11, 2007
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://www.clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/541d2233-b924-443f-ac9f-647817decbff/38D950FD-E7B2-4B6A-AA71-F0D7594E8A8F/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://www.madprops.org/cs/blogs/mabster/archive/2007/10/10/add-logic-to-interfaces-using-extension-methods.aspx" href="http://www.madprops.org/cs/blogs/mabster/archive/2007/10/10/add-logic-to-interfaces-using-extension-methods.aspx" style="font-size: 11px;">www.madprops.org</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.madprops.org/cs/blogs/mabster/archive/2007/10/10/add-logic-to-interfaces-using-extension-methods.aspx"><H2>Add Logic to Interfaces using Extension Methods</H2></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.madprops.org/cs/blogs/mabster/archive/2007/10/10/add-logic-to-interfaces-using-extension-methods.aspx"><P>Here's the rub: When I add new farms to the database, I want to set that farm's ID to the new farm row's ID. It's an identity int in SQL Server so it gets the next available value. But ... Farm.ID is read-only! How the heck am I supposed to change it?</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.madprops.org/cs/blogs/mabster/archive/2007/10/10/add-logic-to-interfaces-using-extension-methods.aspx"><P>Right now we've taken the easy way out and made Farm.ID a read/write property. It lets us set the ID in the providers we implement, and we just have to hope that other developers don't go changing the value before they save existing farms. Not ideal.</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://www.madprops.org/cs/blogs/mabster/archive/2007/10/10/add-logic-to-interfaces-using-extension-methods.aspx"><P>So today I played a bit in beta 2 of Visual Studio 2008, and tried something out.</P></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/38D950FD-E7B2-4B6A-AA71-F0D7594E8A8F/blog/" title="blog or email this clip"><img src="http://content8.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Blog
Copyright
Privacy
EULA
OK