<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>aspnetmvc</title>
        <link>http://www.sheldonj.com/category/1.aspx</link>
        <description>aspnetmvc</description>
        <language>en-US</language>
        <copyright>Jeff Sheldon</copyright>
        <generator>Subtext Version 2.1.2.2</generator>
        <item>
            <title>Oh yeah&amp;hellip;.</title>
            <link>http://www.sheldonj.com/archive/2009/09/12/13.aspx</link>
            <description>&lt;p&gt;I forgot a couple of things I wanted to say…&lt;/p&gt;  &lt;p&gt;Firstly, it’s been a while since I updated &lt;a href="http://www.subtextproject.com/"&gt;Subtext&lt;/a&gt;, so I went ahead and did that.  And just in case you’re as dumb as I am, late me save you a few minutes by informing you to make sure you don’t copy up the web.config blindly.  Oh yeah…there was 5 minutes of my time wasted digging around for the connection string to the blog’s database so I could put the site back together…Good times….&lt;/p&gt;  &lt;p&gt;But back to KodeBits.  I wanted to touch on my reasoning behind this..  I’ve been playing around with &lt;a href="http://www.asp.net/mvc" target="_blank"&gt;ASP.NET MVC&lt;/a&gt; for a little while now, and I’ve been really looking for a site to build with it.  And now that &lt;a href="http://www.asp.net/mvc"&gt;ASP.NET MVC 2&lt;/a&gt; is on it’s way, I finally figure something out.   The technologies I’m using are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.subsonicproject.com" target="_blank"&gt;SubSonic&lt;/a&gt; AND Entity Framework (That’s right both)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.asp.net" target="_blank"&gt;ASP.NET&lt;/a&gt; MVC 1.0 (Will upgrade to 2.0 once that’s in VS2010)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;Structure Map&lt;/a&gt; – Don’t know how I got along without this..&lt;/li&gt;    &lt;li&gt;A whole lot of &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; love&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Yeah, I’m using a simple repository pattern, and I wanted to have two different repository types built off of my Interfaces.  Why? Cuz I can.   I know it’s extra work, but I like the idea of being able to flip between two for no reason whatsoever.  Plus I wanted to show a colleague the benefits of the repository/interface approach.&lt;/p&gt;  &lt;p&gt;Hrm, ok I think that’s it for real this time.&lt;/p&gt;&lt;img src="http://www.sheldonj.com/aggbug/13.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Sheldon</dc:creator>
            <guid>http://www.sheldonj.com/archive/2009/09/12/13.aspx</guid>
            <pubDate>Sat, 12 Sep 2009 22:31:10 GMT</pubDate>
            <wfw:comment>http://www.sheldonj.com/comments/13.aspx</wfw:comment>
            <comments>http://www.sheldonj.com/archive/2009/09/12/13.aspx#feedback</comments>
            <wfw:commentRss>http://www.sheldonj.com/comments/commentRss/13.aspx</wfw:commentRss>
            <trackback:ping>http://www.sheldonj.com/services/trackbacks/13.aspx</trackback:ping>
        </item>
        <item>
            <title>Time to make the donuts!</title>
            <link>http://www.sheldonj.com/archive/2009/08/15/10.aspx</link>
            <description>&lt;p&gt;I haven’t had much to blog about lately, but then ran across &lt;a href="http://blog.wekeroad.com/blog/be-a-good-jedi-build-your-own-blog/"&gt;this post&lt;/a&gt; from &lt;a href="http://blog.wekeroad.com/"&gt;Rob Conery&lt;/a&gt; in which he talks about every developer should have to build their own light saber so to speak.  Every developer should take the time to forge out something for them, that they need, their way.   It’s kind of an inspiring post, if you read some of his comments that go along with it.  While I’m happy with the blog engine I’m using (&lt;a href="http://subtextproject.com/"&gt;Subtext&lt;/a&gt;) for the most part, I don’t think I use it enough.   I think if I spend the time writing one, and maybe blogging about my progress, it might open me up to blogging in the future.&lt;/p&gt;  &lt;p&gt;It’s tough to sit here and write your thoughts online and open yourself up to a great deal of criticism, but a lot of others do it, and they’re still breathing.  I suppose since no one reads this thing, I can just consider it a resource for myself, a place I can come back to for snippets or ideas I shelved in the past.&lt;/p&gt;  &lt;p&gt;Now… lets make my shopping list..  &lt;br /&gt;&lt;/p&gt;  &lt;h3&gt;Technologies&lt;/h3&gt;  &lt;p&gt;I’m pretty sure I want to use  &lt;a href="http://www.asp.net/mvc" target="_blank"&gt;ASP.NET MVC 2&lt;/a&gt; and &lt;a href="http://www.subsonicproject.com" target="_blank"&gt;SubSonic 3&lt;/a&gt;.  My reasoning here is, if I’m not mistaken, I can’t use the &lt;a href="http://www.asp.net" target="_blank"&gt;&lt;a href="http://www.asp.net/mvc" target="_blank"&gt;ASP.NET MVC&lt;/a&gt; 2&lt;/a&gt; Beta with VS2010, so that keeps me using .NET 3.5 (As much as I’d like to start using the new Entity Framework)  Also, I haven’t used &lt;a href="http://www.subsonicproject.com" target="_blank"&gt;SubSonic&lt;/a&gt; in a while, I’d like to get back into it and see what features they’ve added.&lt;/p&gt;  &lt;p&gt;Maybe I can find some places to inject some &lt;a href="http://www.silverlight.net" target="_blank"&gt;Silverlight 3&lt;/a&gt;?&lt;/p&gt;  &lt;h3&gt;Ideas&lt;/h3&gt;  &lt;p&gt;Well, I’d like for it to work with Windows Live Writer.   That’s how I create my posts now, and it’s helpful.   &lt;br /&gt;    &lt;br /&gt;Need to have your basics…  Rss Feeds, Recent Posts, Tag Cloud……&lt;/p&gt;  &lt;p&gt;Interactivity, the only interaction between visitors and a blog seems to be comments, I wonder if I can come up with something more…&lt;/p&gt;  &lt;p&gt;I really like the feel and flow of &lt;a href="http://stackoverflow.com/" target="_blank"&gt;Stack Overflow&lt;/a&gt;, I’d like to present the same fluid kind of feel.  &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;h3&gt;Design&lt;/h3&gt;  &lt;p&gt;Lets think about design patterns.  I’m a big fan of a kind of pseudo repository pattern where an IQueryable object is passed up to from the data layer, through the business layer directly to the consumer.   But maybe it’s time to try something different.&lt;/p&gt;  &lt;p&gt;While I’m using the latest and greatest, I think I’ll use the &lt;a href="http://www.telerik.com/products/aspnet-mvc.aspx" target="_blank"&gt;new MVC controls&lt;/a&gt; by &lt;a href="http://www.telerik.com/" target="_blank"&gt;Telerik&lt;/a&gt;.  I’ve used all of Telerik’s controls at some point over the past few years, but these are open source, so I think I’ll include them in this project.  (Going to release the full source, so don’t want any third party stuff blocking that).&lt;/p&gt;  &lt;p&gt;I want administration to be a no brainer.&lt;/p&gt;  &lt;p&gt;Auto Linking….    Live Writer does it already, but it might be kind of neat to implement it in the engine itself.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;That’s enough for now, let me go think on this some, and come up with a name.&lt;/p&gt;&lt;img src="http://www.sheldonj.com/aggbug/10.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Sheldon</dc:creator>
            <guid>http://www.sheldonj.com/archive/2009/08/15/10.aspx</guid>
            <pubDate>Sat, 15 Aug 2009 18:28:15 GMT</pubDate>
            <wfw:comment>http://www.sheldonj.com/comments/10.aspx</wfw:comment>
            <comments>http://www.sheldonj.com/archive/2009/08/15/10.aspx#feedback</comments>
            <wfw:commentRss>http://www.sheldonj.com/comments/commentRss/10.aspx</wfw:commentRss>
            <trackback:ping>http://www.sheldonj.com/services/trackbacks/10.aspx</trackback:ping>
        </item>
        <item>
            <title>It has begun!</title>
            <link>http://www.sheldonj.com/archive/2008/10/29/it_has_begun.aspx</link>
            <description>&lt;p&gt;Well I feel the need to start sharing.   Though I don't know what I'll share, mostly what I learn is from other blogs.  But who cares? No one knows who I am yet anyway, right?&lt;br /&gt;
&lt;br /&gt;
So what do I have to talk about today?  My incessant need to continuously find a "better way".  There's this project of mine, that I've been working on for about 2 years now.  The problem is I keep having to put it only hold for various reasons.  (I'm sure others can relate)  The problem is, when I come back to it, and look over the code, I'm disgusted.   Over my "break" from the code, I've continued to read, and learn, and now that I've picked my project up again, I know of a "better way" or simply just want to apply some knowledge I've learned.&lt;/p&gt;
&lt;p&gt;This project started off as a basic &lt;a target="_blank" href="http://www.asp.net"&gt;ASP.NET&lt;/a&gt; web site using &lt;a target="_blank" href="http://www.subsonicproject.com"&gt;SubSonic&lt;/a&gt; as my tool of choice for access the database.  And now?  It's an &lt;a target="_blank" href="http://www.asp.net/mvc"&gt;ASP.NET MVC&lt;/a&gt; application using the entity framework.   Speaking of which, Hat's off the the ASP.NET MVC devs!&lt;/p&gt;
&lt;p&gt;So what hunk of code do I have today?  Well this CacheManager tool I've been messin around with.   Here's the primary static method I'm using.  &lt;/p&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red255\green255\blue255;\red16\green16\blue16;\red138\green197\blue255;\red192\green192\blue192;\red255\green111\blue183;\red255\green128\blue64;\red100\green177\blue255;\red255\green255\blue170;\red255\green255\blue128;\red214\green173\blue173;}??\fs26 \cf1\cb2\highlight2         \cf3 public\cf1  \cf3 static\cf1  T HandleCache\cf4 &amp;lt;\cf1 T\cf4 &amp;gt;\cf1 (\cf5 IQueryable\cf4 &amp;lt;\cf1 T\cf4 &amp;gt;\cf1  Query, \cf3 object\cf1  Value, \cf3 int\cf4 ?\cf1  MinToExpire)\par ??        \{\par ??            \cf3 var\cf1  keyName \cf4 =\cf1  \cf3 string\cf4 .\cf1 Format(\cf6 "\{0\}_\{1\}"\cf1 , \cf3 typeof\cf1 (T), Value);\par ??            \cf3 if\cf1  (\cf7 HttpContext\cf4 .\cf1 Current\cf4 .\cf1 Cache[keyName] \cf4 !=\cf1  \cf3 null\cf1  \cf4 &amp;amp;&amp;amp;\cf1  \cf7 HttpContext\cf4 .\cf1 Current\cf4 .\cf1 Cache[keyName] \cf3 is\cf1  T)\par ??                \cf3 return\cf1  (T)\cf7 HttpContext\cf4 .\cf1 Current\cf4 .\cf1 Cache[keyName];\par ??\par ??            \cf3 var\cf1  item \cf4 =\cf1  Query\cf4 .\cf1 FirstOrDefault();\par ??            \cf3 if\cf1  (item \cf4 !=\cf1  \cf3 null\cf1 )\par ??            \{\par ??                \cf3 if\cf1  (MinToExpire\cf4 .\cf1 HasValue)\par ??                    \cf7 HttpContext\cf4 .\cf1 Current\cf4 .\cf1 Cache\cf4 .\cf1 Add(keyName, item, \cf3 null\cf1 , \cf8 DateTime\cf4 .\cf1 MaxValue, \cf3 new\cf1  \cf8 TimeSpan\cf1 (\cf9 0\cf1 , MinToExpire\cf4 .\cf1 Value, \cf9 0\cf1 ), \cf10 CacheItemPriority\cf4 .\cf1 Normal, \cf3 null\cf1 );\par ??                \cf3 else\par ??\cf1                     \cf7 HttpContext\cf4 .\cf1 Current\cf4 .\cf1 Cache\cf4 .\cf1 Insert(keyName, item);\par ??            \}\par ??            \cf3 return\cf1  item;\par ??        \}}
--&gt;
&lt;div style="background: rgb(16, 16, 16) none repeat scroll 0% 0%; font-family: Courier New; font-size: 10pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(138, 197, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(138, 197, 255);"&gt;static&lt;/span&gt; T HandleCache&lt;span style="color: silver;"&gt;&amp;lt;&lt;/span&gt;T&lt;span style="color: silver;"&gt;&amp;gt;&lt;/span&gt;(&lt;span style="color: rgb(255, 111, 183);"&gt;IQueryable&lt;/span&gt;&lt;span style="color: silver;"&gt;&amp;lt;&lt;/span&gt;T&lt;span style="color: silver;"&gt;&amp;gt;&lt;/span&gt; Query, &lt;span style="color: rgb(138, 197, 255);"&gt;object&lt;/span&gt; Value, &lt;span style="color: rgb(138, 197, 255);"&gt;int&lt;/span&gt;&lt;span style="color: silver;"&gt;?&lt;/span&gt; MinToExpire)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(138, 197, 255);"&gt;var&lt;/span&gt; keyName &lt;span style="color: silver;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(138, 197, 255);"&gt;string&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Format(&lt;span style="color: rgb(255, 128, 64);"&gt;"{0}_{1}"&lt;/span&gt;, &lt;span style="color: rgb(138, 197, 255);"&gt;typeof&lt;/span&gt;(T), Value);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(138, 197, 255);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(100, 177, 255);"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Current&lt;span style="color: silver;"&gt;.&lt;/span&gt;Cache[keyName] &lt;span style="color: silver;"&gt;!=&lt;/span&gt; &lt;span style="color: rgb(138, 197, 255);"&gt;null&lt;/span&gt; &lt;span style="color: silver;"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style="color: rgb(100, 177, 255);"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Current&lt;span style="color: silver;"&gt;.&lt;/span&gt;Cache[keyName] &lt;span style="color: rgb(138, 197, 255);"&gt;is&lt;/span&gt; T)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                &lt;span style="color: rgb(138, 197, 255);"&gt;return&lt;/span&gt; (T)&lt;span style="color: rgb(100, 177, 255);"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Current&lt;span style="color: silver;"&gt;.&lt;/span&gt;Cache[keyName];&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(138, 197, 255);"&gt;var&lt;/span&gt; item &lt;span style="color: silver;"&gt;=&lt;/span&gt; Query&lt;span style="color: silver;"&gt;.&lt;/span&gt;FirstOrDefault();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(138, 197, 255);"&gt;if&lt;/span&gt; (item &lt;span style="color: silver;"&gt;!=&lt;/span&gt; &lt;span style="color: rgb(138, 197, 255);"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                &lt;span style="color: rgb(138, 197, 255);"&gt;if&lt;/span&gt; (MinToExpire&lt;span style="color: silver;"&gt;.&lt;/span&gt;HasValue)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &lt;span style="color: rgb(100, 177, 255);"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Current&lt;span style="color: silver;"&gt;.&lt;/span&gt;Cache&lt;span style="color: silver;"&gt;.&lt;/span&gt;Add(keyName, item, &lt;span style="color: rgb(138, 197, 255);"&gt;null&lt;/span&gt;, &lt;span style="color: rgb(255, 255, 170);"&gt;DateTime&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;MaxValue, &lt;span style="color: rgb(138, 197, 255);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(255, 255, 170);"&gt;TimeSpan&lt;/span&gt;(&lt;span style="color: rgb(255, 255, 128);"&gt;0&lt;/span&gt;, MinToExpire&lt;span style="color: silver;"&gt;.&lt;/span&gt;Value, &lt;span style="color: rgb(255, 255, 128);"&gt;0&lt;/span&gt;), &lt;span style="color: rgb(214, 173, 173);"&gt;CacheItemPriority&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Normal, &lt;span style="color: rgb(138, 197, 255);"&gt;null&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                &lt;span style="color: rgb(138, 197, 255);"&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                    &lt;span style="color: rgb(100, 177, 255);"&gt;HttpContext&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;Current&lt;span style="color: silver;"&gt;.&lt;/span&gt;Cache&lt;span style="color: silver;"&gt;.&lt;/span&gt;Insert(keyName, item);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(138, 197, 255);"&gt;return&lt;/span&gt; item;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
See, I'm lazy... I just want to call something like: &lt;br /&gt;
&lt;br /&gt;
&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Consolas;}}{\colortbl;??\red255\green255\blue255;\red16\green16\blue16;\red192\green192\blue192;\red100\green177\blue255;\red255\green255\blue128;}??\fs26 \cf1\cb2\highlight2 var account \cf3 =\cf1  \cf4 CacheManager\cf3 .\cf1 HandleCache\cf3 &amp;lt;\cf1 Account\cf3 &amp;gt;\cf1 (m_AccounService\cf3 .\cf1 GetAccount()\cf3 .\cf1 WithID(UserID), UserID, \cf5 20\cf1 );}
--&gt;
&lt;div style="background: rgb(16, 16, 16) none repeat scroll 0% 0%; font-family: Courier New; font-size: 10pt; color: white; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;
&lt;p style="margin: 0px;"&gt;var account &lt;span style="color: silver;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(100, 177, 255);"&gt;CacheManager&lt;/span&gt;&lt;span style="color: silver;"&gt;.&lt;/span&gt;HandleCache&lt;span style="color: silver;"&gt;&amp;lt;&lt;/span&gt;Account&lt;span style="color: silver;"&gt;&amp;gt;&lt;/span&gt;(m_AccounService&lt;span style="color: silver;"&gt;.&lt;/span&gt;GetAccount()&lt;span style="color: silver;"&gt;.&lt;/span&gt;WithID(UserID), UserID, &lt;span style="color: rgb(255, 255, 128);"&gt;20&lt;/span&gt;);&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
And poof have my Account object (If it exists) and have it all cached up and ready to go.  I just feel like there could be a better way.
&lt;div style="margin: 0px; padding: 0px; display: inline; float: none;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:553ac478-01ae-4df3-b16b-f5d7aa2d1bb6" class="wlWriterSmartContent"&gt;&lt;br /&gt;
&lt;br /&gt;
Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/aspnetmvc"&gt;aspnetmvc&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/subsonic"&gt;subsonic&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Caching"&gt;Caching&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.sheldonj.com/aggbug/6.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Sheldon</dc:creator>
            <guid>http://www.sheldonj.com/archive/2008/10/29/it_has_begun.aspx</guid>
            <pubDate>Wed, 29 Oct 2008 20:15:37 GMT</pubDate>
            <wfw:comment>http://www.sheldonj.com/comments/6.aspx</wfw:comment>
            <comments>http://www.sheldonj.com/archive/2008/10/29/it_has_begun.aspx#feedback</comments>
            <wfw:commentRss>http://www.sheldonj.com/comments/commentRss/6.aspx</wfw:commentRss>
            <trackback:ping>http://www.sheldonj.com/services/trackbacks/6.aspx</trackback:ping>
        </item>
    </channel>
</rss>