<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-16719306352505132</id><updated>2011-12-07T07:53:57.950-06:00</updated><category term='Introduction'/><category term='Book Review'/><category term='Professionalism'/><category term='DoctorConnect'/><category term='Political'/><category term='RPGs'/><category term='BizTalk'/><category term='UI'/><category term='Expectation Management'/><category term='XML'/><category term='Kindle Fire'/><category term='X12'/><category term='Schemas'/><category term='Streams'/><category term='ASP.NET'/><category term='C#'/><category term='EDI'/><category term='WSDL'/><category term='MVC3'/><category term='Community'/><category term='Oops'/><category term='Coding 201'/><category term='HIPAA'/><category term='WCF'/><category term='consulting'/><category term='MVC Issue Tracker'/><category term='PGP'/><category term='Projects'/><category term='career'/><category term='User Group'/><category term='Something Different'/><category term='Services'/><category term='WPF'/><category term='Public Code Review'/><category term='neat stuff'/><category term='update'/><category term='Silverlight'/><category term='Serialization'/><category term='ConnectedSystems'/><category term='MIA'/><title type='text'>EDI-fication</title><subtitle type='html'>Follow along as I learn and delve into the murky world of EDI Development.  I'll take detours into politics and religion along the way.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6421977146492729269</id><published>2011-12-07T07:53:00.002-06:00</published><updated>2011-12-07T07:53:57.958-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oops'/><title type='text'>Don't try this at home.</title><content type='html'>And &lt;a href="http://www.foxnews.com/entertainment/2011/12/06/mythbusters-cannon-accidentally-launches-into-california-home/?test=faces"&gt;this&lt;/a&gt; is why.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6421977146492729269?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6421977146492729269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/12/dont-try-this-at-home.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6421977146492729269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6421977146492729269'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/12/dont-try-this-at-home.html' title='Don&apos;t try this at home.'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-4270249107778559914</id><published>2011-11-25T10:56:00.000-06:00</published><updated>2011-11-25T10:56:47.522-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='neat stuff'/><category scheme='http://www.blogger.com/atom/ns#' term='Kindle Fire'/><title type='text'>Kindle,Kindle woo-hoo!</title><content type='html'>So, I got my Kindle Fire Wednesday afternoon.&amp;nbsp; I've had a little chance to play with it.&lt;br /&gt;
&lt;br /&gt;
A full "Un-boxing and review" post will come later, but here are some quick impressions.&lt;br /&gt;
&lt;br /&gt;
For what I plan to do with it, it seems fine.&amp;nbsp; Browsing the internet, downloading and using apps, watching videos: all of these things are great (so far).&amp;nbsp; My only problem is that I had been planning to post this from the Kindle.&amp;nbsp; That didn't work.&lt;br /&gt;
&lt;br /&gt;
Everywhere else I've been trying to post has been fine, so it may just be the Blogger interface, but I was hoping that short posts would be without too much pain.&amp;nbsp; That seems not to be the case at the moment.&amp;nbsp; Maybe I'll figure it out after playing with it some more, but that is my only pain point, it seems.&lt;br /&gt;
&lt;br /&gt;
All in all, I give it a solid 3.5 / 5 on a preliminary basis.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-4270249107778559914?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/4270249107778559914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/11/kindlekindle-woo-hoo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/4270249107778559914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/4270249107778559914'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/11/kindlekindle-woo-hoo.html' title='Kindle,Kindle woo-hoo!'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6320241031410789653</id><published>2011-06-19T13:14:00.001-05:00</published><updated>2011-06-19T13:14:17.072-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coding 201'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Book Review'/><title type='text'>C# In Depth 2nd. Ed.: A (partial) Review</title><content type='html'>&lt;p&gt;I’m currently reading &lt;em&gt;&lt;a href="http://www.manning.com/skeet2/"&gt;C# In Depth: 2nd Edition&lt;/a&gt;&lt;/em&gt; (&lt;a href="http://msmvps.com/blogs/jon_skeet/default.aspx"&gt;Jon Skeet&lt;/a&gt;, Manning Publications), and I thought I’d share my thoughts about it so far.&lt;/p&gt;  &lt;p&gt;I would say I’ll do this in three parts: the good, the bad, an my take, but really there’s only “the good.”&amp;#160; &lt;/p&gt;  &lt;p&gt;I consider myself to be a mediocre-to-good developer.&amp;#160; I still have lots to learn and my code can always get better.&amp;#160; Hanging out on &lt;a href="http://stackoverflow.com"&gt;StackOverflow.com&lt;/a&gt;, I get to see Jon’s casual mastery of C# nearly every day.&amp;#160; I can only thank him for the help he’s been to me- even if he’s never actually answered one of my questions (or, at least, I don’t remember that he has, and I think that would stick with me…)&lt;/p&gt;  &lt;p&gt;C# In Depth is the work of a master.&amp;#160; They say that you’ve truly mastered something- not when you understand it, but when you can communicate that understanding clearly.&amp;#160; By that standard, Mr. Skeet has truly mastered C#.&lt;/p&gt;  &lt;p&gt;The book begins with a look, a retrospective if you will, of C# 1.&amp;#160; I, for one, noticed the fondness Mr. Skeet still holds for the old language (and, as he would point out, the BCL and CLR that went with it).&amp;#160; Even as he points out its flaws- which it must have, or why even bother with C#2, 3, &amp;amp; 4- he also takes care to explain things so clearly that one can see a huge proponent of the language.&lt;/p&gt;  &lt;p&gt;From pointing out the flaws in C#1, the book proceeds through C#2 and its enhancements to C#3.5 (where I currently am) and will proceed to C#4.&amp;#160; At each level, the detail he provides about how the language actually works is quite comprehensive- or, as comprehensive as a book meant for actual consumption can be.&amp;#160; Moreover, his explanations and examples pointed out, quite clearly, places I could improve my own code, or explained to me the “why” of things I had taken for granted.&lt;/p&gt;  &lt;p&gt;As a C# developer who considers myself in the “Coding 201” camp (Okay, I may have graduated to Coding 202), I cannot imagine a better technical book to have at one’s fingertips.&amp;#160; Where other books range (within the same book) from simple (and sometimes misguided) pedantry in text to oversimplification and hand-waving in examples, C# In Depths seems to have hit that perfect sweet-spot of the text being concise enough not to put me to sleep, and examples being robust enough to see what would actually happen.&lt;/p&gt;  &lt;p&gt;I highly recommend you read the book, if you haven’t already.&amp;#160; I can virtually guarantee that it will improve your coding game as you begin to understand why some things work the way they do.&lt;/p&gt;  &lt;p&gt;I also recommend you go (and subscribe) to &lt;a href="http://msmvps.com/blogs/jon_skeet/default.aspx"&gt;his coding blog&lt;/a&gt;.&amp;#160; It’s on my must-read list.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6320241031410789653?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6320241031410789653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/c-in-depth-2nd-ed-partial-review.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6320241031410789653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6320241031410789653'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/c-in-depth-2nd-ed-partial-review.html' title='C# In Depth 2nd. Ed.: A (partial) Review'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-9138049674177624736</id><published>2011-06-14T07:48:00.001-05:00</published><updated>2011-06-14T07:48:30.801-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ConnectedSystems'/><category scheme='http://www.blogger.com/atom/ns#' term='Projects'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='DoctorConnect'/><title type='text'>A New Project: DoctorConnect</title><content type='html'>&lt;p&gt;Welcome back!&lt;/p&gt;  &lt;p&gt;Today I’m introducing a new project- again, mostly to help me learn stuff.&amp;#160; This one is a little more complex and will actually involve at least 2 and probably 3 sub-projects.&amp;#160; I call it DoctorConnect.&lt;/p&gt;  &lt;p&gt;The theory is this: Assume that a Doctor’s office wanted to enable its patients to do some basic tasks online without having to call and wait for a nurse to call them back.&amp;#160; We’ve all had to do that, right?&amp;#160; You’re puking your guts out, and you have to wait for the nurse to call you back before you know if they can see you today (saving you $$$) or if you have to go to some Doc-in-a-Box Urgent Care place.&lt;/p&gt;  &lt;p&gt;So: DoctorConnect.&lt;/p&gt;  &lt;p&gt;It will be a system in 3 parts: A database (SQL Server 2008 R2), an internal web application (haven’t decided on MVC or Web Forms, yet) and an external web page.&amp;#160; After all that’s done, I may also design a mobile-app for the project: so users could schedule an appointment on-the-go.&lt;/p&gt;  &lt;p&gt;This is a big project for me, and I’m going to have to master some things that I haven’t mastered yet before I get it right.&lt;/p&gt;  &lt;p&gt;First: The DB.&amp;#160; I’ll need to map my DB tables to Objects.&amp;#160; This is complex enough a data model (more on that in another post) that I don’t fully trust EF, and I don’t trust my own skills at Linq-2-SQL enough.&amp;#160; So I’ll be looking at various ORM options to determine the best way to go.&lt;/p&gt;  &lt;p&gt;Second: Membership.&amp;#160; Unlike the Issue Tracker, this will require a custom membership provider: I’ll need to know not only if someone is an authenticated user, but exactly what things they should be able to see.&amp;#160; On the internal application, that may be role-based, but on the external application, it will have to be something else- some hierarchy model that allows for a Responsible Party to see all the accounts for which he (or she) is responsible, but let other patients see only their own accounts.&lt;/p&gt;  &lt;p&gt;Third: Polymorphic Data.&amp;#160; What I mean is this:&amp;#160; A patient, when scheduling an appointment, doesn’t need to know all the information about a specific doctor, just their name, specialty (so they don’t go see an OB/GYN about their prostate), and availability.&amp;#160; On the other hand, the Office Staff need to know just about everything about a patient.&amp;#160; How should I handle that?&lt;/p&gt;  &lt;p&gt;Fourth: Scheduling.&amp;#160; I’ll need a way to set an appointment for a doctor and validate it against other scheduled events: we don’t want patients to be able to schedule an appointment during lunch, for instance, or while that doctor is on vacation.&amp;#160; So I’ll need to figure that out.&lt;/p&gt;  &lt;p&gt;All in all, this is shaping up to be a big project.&amp;#160; So let’s start eating this elephant: one bite at a time.&amp;#160; Next up: the data model.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-9138049674177624736?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/9138049674177624736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/new-project-doctorconnect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/9138049674177624736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/9138049674177624736'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/new-project-doctorconnect.html' title='A New Project: DoctorConnect'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-5973552740741486572</id><published>2011-06-09T05:56:00.000-05:00</published><updated>2011-06-09T05:56:30.256-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='User Group'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Community'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>"I'd like to thank all the Little People..."</title><content type='html'>I'm a member of the D/FW Connected Systems User Group.&amp;nbsp; Last night we held officer elections and I was honored by being selected as the Vice President of Meetings (not as big a deal as it sounds, but nice nonetheless).&amp;nbsp; So expect to see a lot more content specifically related to DFWCSUG on the blog for the next year or so.&lt;br /&gt;
&lt;br /&gt;
You can find us &lt;a href="http://dfwcsug.com/"&gt;here&lt;/a&gt; if you're interested.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-5973552740741486572?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/5973552740741486572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/id-like-to-thank-all-little-people.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/5973552740741486572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/5973552740741486572'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/id-like-to-thank-all-little-people.html' title='&quot;I&apos;d like to thank all the Little People...&quot;'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-3619812861201433178</id><published>2011-06-08T07:27:00.001-05:00</published><updated>2011-06-08T07:27:37.090-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Professionalism'/><category scheme='http://www.blogger.com/atom/ns#' term='consulting'/><title type='text'>On Professionalism</title><content type='html'>&lt;p&gt;Yesterday, two of my co-workers, a fellow consultant and one of the client’s FTEs, were having a dispute about some procedural issues.&amp;#160; I’m not going to discus specifics, nor who was “right,” that’s not the point of this post.&lt;/p&gt;  &lt;p&gt;In the course of the dispute, both sent fairly preemptory emails, and exchanged harsh- though still mostly civil- words verbally as well.&amp;#160; For the rest of us in the area, it was fairly uncomfortable, and I hope they thought so as well, once they each cooled down and thought about it.&lt;/p&gt;  &lt;p&gt;In this particular case, the major issue was that neither side was actually listening to the other.&amp;#160;&amp;#160; Had either been willing to set their assumptions aside for thirty seconds while the other completed a statement, I believe the issue would have been resolved much sooner than it was.&lt;/p&gt;  &lt;p&gt;So, for the record, let’s set out some rules about workplace disagreements.&lt;/p&gt;  &lt;p&gt;1: &lt;strong&gt;&lt;font color="#f79646"&gt;Don’t have public arguments.&amp;#160; Ever.&lt;/font&gt;&lt;/strong&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;This is highly important.&amp;#160; When you argue with a colleague, nothing good comes from it.&amp;#160; More-over, you will probably hurt the group by causing it to divide into factions over who is right.&amp;#160; Finally, you hurt the group in the eyes of any other observer who may be walking by.&lt;/p&gt;  &lt;p&gt;When you have a disagreement, take the person with whom you disagree aside and have a private discussion.&amp;#160; If you can secure an office or conference room, feel free to yell.&lt;/p&gt;  &lt;p&gt;2: &lt;strong&gt;&lt;font color="#f79646"&gt;Listening doesn’t just mean waiting for the other person to finish speaking.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Every “conflict resolution” class ever in the history of ever has agreed on this point.&amp;#160; When the other person is speaking, you should not be thinking about what you’re going to say next, you should be paying attention to them.&lt;/p&gt;  &lt;p&gt;Most people don’t do things that don’t make sense- when viewed from their perspective.&amp;#160; So, when someone is saying something that doesn’t make sense to you, you’re probably holding a different set of assumptions than the person to whom you’re speaking.&amp;#160; The correct answer, at that point, is to check your own assumptions at the door, and try to see things from a viewpoint where what the other person is saying is reasonable.&amp;#160; Once you’re able to do that- even if you disagree- you’ll be much more able to remain polite.&lt;/p&gt;  &lt;p&gt;Politeness helps speed the resolution of the issue.&lt;/p&gt;  &lt;p&gt;3: &lt;strong&gt;&lt;font color="#f79646"&gt;Never assume.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#cccccc"&gt;I mean that.&amp;#160; Never make assumptions beyond those necessary to hold a conversation.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The argument yesterday could have been shortened considerably had either party, let alone both, stopped assuming that the other was being unreasonable (see point 2).&amp;#160; The issue was over a particular process and whether it had been followed in a particular case.&amp;#160; One party assumed the process hadn’t been followed, the other assumed it had, and there was no clear evidence one way or the other.&lt;/p&gt;  &lt;p&gt;Had each party checked their assumptions at the door, the entire exchange would have gone something like this:&lt;/p&gt;  &lt;p&gt;“Hey, when [Resource X] did such-and-such, did they make sure to follow [Procedure Y]?”&lt;/p&gt;  &lt;p&gt;“I’m sure they did, but I’ll send an email {the other resource is off-shore} to make sure of that.”&lt;/p&gt;  &lt;p&gt;So, the next time you have a disagreement with a co-worker, whether you or they are a consultant, contractor, FTE, PTE, or whatever, remember that the rest of the office would much prefer it if you keep things professional and civil.&amp;#160; If you’re unable to comply with either of those, take the argument somewhere the rest of us don’t have to hear it.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-3619812861201433178?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/3619812861201433178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/on-professionalism.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3619812861201433178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3619812861201433178'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/on-professionalism.html' title='On Professionalism'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-2675927300105445916</id><published>2011-06-06T09:38:00.000-05:00</published><updated>2011-06-06T09:38:16.550-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC3'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC Issue Tracker'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>MVC Issue Tracker: Where We've Been</title><content type='html'>I should have the final code zipped and pushed to CodePlex as a download sometime today or tomorrow.&amp;nbsp; This post is sort of a retrospective on what we've already done.&lt;br /&gt;
&lt;br /&gt;
If you missed the posts, here they are in order&lt;br /&gt;
&lt;a href="http://edi-fication.blogspot.com/2011/05/aspnet-mvc-journey.html"&gt;Introduction &lt;/a&gt;&lt;br /&gt;
&lt;a href="http://edi-fication.blogspot.com/2011/05/issue-tracker-setting-up.html"&gt;Part 1- Setting Up&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://edi-fication.blogspot.com/2011/05/mvc-issue-tracker-part-2.html"&gt;Part 2- Controllers&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-ancillary-issues.html"&gt;Part 2.5- Ancillary Issues&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-part-3.html"&gt;Part 3- Cleaning Up the Views&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-part-4.html"&gt;Part 4- Finishing Up&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So, some impressions to wrap up:&lt;br /&gt;
&lt;br /&gt;
First off, while I would have liked to implement my own authorization system, MVC3's provided version met all my needs quite well, and so there was no reason to handle that.&amp;nbsp; So that got cut out at the end.&amp;nbsp; I do like the fact that, for almost all scenarios, the MVC3 provided authorization model works well enough.&amp;nbsp; Perhaps someone with exceptionally high security needs would be required to create their own model, but I doubt anyone with such needs would be using MVC (the product) anyway.&lt;br /&gt;
&lt;br /&gt;
Which leads me to my second point.&amp;nbsp; ASP.NET MVC3 seems to me like something a small company (even big for a small company, but small nonetheless) would use to get a website up and running relatively quickly.&amp;nbsp; I can see that it has plenty of power for the mid-sized business as well, but once you get up to larger enterprises, I see things I believe would cause some problems.&lt;br /&gt;
&lt;br /&gt;
First, I don't like the lack of separation of the code.&amp;nbsp; MVC3, by default at least, throws all your code into one project.&amp;nbsp; I believe that my Model code (let's face it, it's the Data Layer) should be in a separate project, at least, and possibly a separate solution.&amp;nbsp; The Controller code- being the Business Layer- should, to my mind, be likewise separated- either in a separate project or separate solution.&lt;br /&gt;
&lt;br /&gt;
Now, I don't see any reason you couldn't use MVC like methodology and still have those layers of separation, but MVC3, in itself, is fairly dependent upon having all that code in the same project- at the very least for auto-generating views and controllers.&amp;nbsp; I may be wrong, but it seemed to me that MVC was built on the idea that all of this code would be in the same project.&amp;nbsp; That's fine for fairly small and/or encapsulated applications, but a larger enterprise with multiple web applications may very well have need to separate those layers better simply because they want people to interact very differently (beyond simple authorization issues) with the same data.&lt;br /&gt;
&lt;br /&gt;
Take, for instance, the sample project the good folks at MS use of Contoso University.&amp;nbsp; Their MVC3 tutorial walks you through setting up a way to enroll students, or add classes, or whatnot.&amp;nbsp; In a real life situation, that enrollment, and most of the administrative functions, would be handled (if they used MS Technologies at all) on an internal only application- whether an intranet application or a windows application- and all anyone logging in would be able to do is some basic maintenance of their own student account and request enrollment (with the actual enrollment being handled by some other application to ensure class sizes were set properly, etc.).&amp;nbsp; This would lead to it making more sense to have that level of separation.&lt;br /&gt;
&lt;br /&gt;
Now, my thought is that MS would be saying, "You're right- so you don't use MVC for that."&amp;nbsp; That's a completely reasonable expectation- but it is something to be aware of.&lt;br /&gt;
&lt;br /&gt;
All in all, however, I was impressed by the power of MVC and the ease with which the application came together.&amp;nbsp; Certainly it would need a lot of cleaning and polishing before anyone used it as an actual production application, but I can see the seeds in there for just such a thing.&amp;nbsp; Add to that the lightweight nature of the newest version of SQL Compact for the database, and a small company could easily use such a thing- instead of some big and expensive tracking system- to track their trouble tickets.&amp;nbsp; And, as with anything that contacts the database, all that really needs to happen if the ticket database grows too big is to create the same db schema in some more robust database (say, full on SQL Server, or whatever) and change the web.config connection string.&lt;br /&gt;
&lt;br /&gt;
I hope this exploration has been as beneficial for you as it was for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-2675927300105445916?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/2675927300105445916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-where-weve-been.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/2675927300105445916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/2675927300105445916'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-where-weve-been.html' title='MVC Issue Tracker: Where We&apos;ve Been'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-3959808331807136802</id><published>2011-06-03T16:53:00.000-05:00</published><updated>2011-06-03T19:38:42.490-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC3'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC Issue Tracker'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>MVC Issue Tracker Part 4</title><content type='html'>&lt;p&gt;This is the penultimate entry in this series.&amp;#160; I’ve completed the code to the level I intend (for the moment) and I’ve verified things work as I expect (for the moment).&lt;/p&gt;  &lt;p&gt;So, let’s look at what we had left to do: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Wire up WorkNote/Create so that it would redirect back to the underlying issue instead of to the index of WorkNote. &lt;/li&gt;    &lt;li&gt;Provide Security. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The first was easy, instead of using “RedirectToAction(“Index”) I changed the code for &amp;quot;Create” to this:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [HttpPost]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult Create(WorkNote worknote)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (ModelState.IsValid)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;                 var issueId = db.Issues.Where(i =&amp;gt; i.IssueId == worknote.IssueId).SingleOrDefault();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;                 worknote.EnteredBy = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HttpContext.User.Identity.Name;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;                 worknote.LoggedDate = DateTime.Now;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;                 db.WorkNotes.Add(worknote);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;                 db.SaveChanges();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #006080"&gt;&amp;quot;Details&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Issue&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; { id = issueId.IssueId });   &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;             ViewBag.IssueId = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SelectList(db.Issues, &lt;span style="color: #006080"&gt;&amp;quot;IssueId&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Title&amp;quot;&lt;/span&gt;, worknote.IssueId);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View(worknote);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Ignore the “IssueId” and “EnteredBy” stuff for now.&amp;#160; The important part is at the end: “return RedirectToAction(“Details”, “Issue”, new {id = issueId.IssueId})';&amp;#160; This tells the controller that, on a successful insert, it should redirect to the “Details” view of the Issue with a specified issue id.&lt;/p&gt;

&lt;p&gt;See?&amp;#160; Easy.&lt;/p&gt;

&lt;p&gt;The next part required some extensive refactoring.&amp;#160; I was going to implement my own security model, but that’s really fairly silly.&amp;#160; MVC3 provides us with a perfectly acceptable method of Role based security, so we’ll just hook into that.&lt;/p&gt;

&lt;p&gt;First, I removed the User class and Role enum, and all the references to same.&amp;#160; Then, using the configuration button, I used the built-in web-based configuration to set up roles, and add a couple of users.&lt;/p&gt;

&lt;p&gt;From there, it was all markup.&amp;#160; Some samples follow:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [Authorize(Roles=&lt;span style="color: #006080"&gt;&amp;quot;Administrators,Manager,Developer,User&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; WorkNoteController : Controller&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This piece just says that only someone logged in as an Admin, Manager, Dev, or User can get to the WorkNoteController.&amp;#160; I have similar authorization on Issue.&lt;/p&gt;

&lt;p&gt;More significantly, on Issue, I marked up some of the specific methods for the IssueController:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [Authorize(Roles = &lt;span style="color: #006080"&gt;&amp;quot;Administrators,Manager,Developer&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;         [HttpPost]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult Edit(Issue issue)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (ModelState.IsValid)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (issue.ClosedDate != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) issue.ClosedBy = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.HttpContext.User.Identity.Name;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;                 db.Entry(issue).State = EntityState.Modified;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;                 db.SaveChanges();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;                 &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #006080"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View(issue);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; [Authorize(Roles = &lt;span style="color: #006080"&gt;&amp;quot;Administrators,Manager&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; [HttpPost, ActionName(&lt;span style="color: #006080"&gt;&amp;quot;Delete&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult DeleteConfirmed(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; id)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; {            &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     Issue issue = db.Issues.Find(id);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     db.Issues.Remove(issue);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     db.SaveChanges();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; RedirectToAction(&lt;span style="color: #006080"&gt;&amp;quot;Index&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;These are specific authorizations required to access specific views: Edit and Delete, respectively.&lt;/p&gt;

&lt;p&gt;So, now, an Administrator would have to create a new user (as one would expect in a business scenario) and provide that user with the correct credentials.&amp;#160; That user would then only be able to access the parts available to the assigned Role.&amp;#160; Basically, a basic user can add issues and can look at issue details/status.&amp;#160; A Developer can do that, but can also edit issues (specifically to close them, when necessary) and add work notes.&amp;#160; Managers and Administrators have the additional authority to delete issues.&lt;/p&gt;

&lt;p&gt;Additionally, since I’m able to use the provided Role based security, I’m also able to avoid the necessity of a “User” object, and just grab the UserName from the Session.&amp;#160; This allows tagging that is just as accurate as building role-based security from scratch, and that is more intuitive, since I can just grab the username instead of the user’s Id, or going through some hoops to take that Id and turn it into their name.&lt;/p&gt;

&lt;p&gt;The final code push is up on CodePlex now, and I’ll zip it all up and add it to the downloads folder soon as well.&lt;/p&gt;

&lt;p&gt;Next Up (In a couple of days): A look back, and my impressions from working with MVC3.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-3959808331807136802?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/3959808331807136802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-part-4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3959808331807136802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3959808331807136802'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-part-4.html' title='MVC Issue Tracker Part 4'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-123613013811772535</id><published>2011-06-03T07:22:00.000-05:00</published><updated>2011-06-03T07:22:44.291-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='RPGs'/><category scheme='http://www.blogger.com/atom/ns#' term='Something Different'/><title type='text'>And now, for Something Completely Different</title><content type='html'>I'm changing lap-tops, which means porting code.&amp;nbsp; To do that, I'm taking the things I think are worth keeping and throwing them up on CodePlex.&amp;nbsp; One in particular, being close to my table-top-rpg-playing heart is my &lt;a href="http://campaignmanager.codeplex.com/"&gt;Campaign Portfolio Manager&lt;/a&gt;.&amp;nbsp; Go check it out, if such things interest you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-123613013811772535?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/123613013811772535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/and-now-for-something-completely.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/123613013811772535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/123613013811772535'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/and-now-for-something-completely.html' title='And now, for Something Completely Different'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-8010229825432747004</id><published>2011-06-02T19:43:00.001-05:00</published><updated>2011-06-02T19:43:50.297-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC3'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC Issue Tracker'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>MVC Issue Tracker: Part 3</title><content type='html'>&lt;p&gt;For this installment of the Issue tracker, I mostly just clean up our views a little bit.&amp;#160; I also added a little functionality for a snap-shot page and provided the ability to add new work notes to an issue.&lt;/p&gt;  &lt;p&gt;Let’s dive in.&lt;/p&gt;  &lt;p&gt;First off, I added a Snap-Shot report to the ‘About’ Page, like so:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-Khx4r9f7PX8/TeguPjlLqnI/AAAAAAAAADU/qsBrWg5yAVo/s1600-h/image%25255B3%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-R949HO2HyJ0/TeguP4Ro7JI/AAAAAAAAADY/ruCtOtdqQF8/image_thumb%25255B1%25255D.png?imgmax=800" width="383" height="491" /&gt;&lt;/a&gt;&lt;/p&gt;        &lt;p&gt;This required very little code, actually, but adds a nice little bit of polish- along with helping me get my head around exactly where we’re going here…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 113.17%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; height: 276px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult About()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;             var allIssues = ctx.Issues;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;             var closedIssues = ctx.Issues.Where(i =&amp;gt; i.ClosedBy != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;             var openIssues = ctx.Issues.Where(i =&amp;gt; i.ClosedBy == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;             var oneWeek = GetClosedInOneWeek(closedIssues);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;             var twoWeeks = GetOpenGreaterThanOneWeek(openIssues);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; oneWeekCount = oneWeek.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; closedCount = closedIssues.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             var pctOneWeek = oneWeekCount.PercentOf(closedCount);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;             ViewBag.CountAllIssues = allIssues.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;             ViewBag.CountClosedIssues = closedIssues.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;             ViewBag.CountOpenIssues = openIssues.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;             ViewBag.OneWeek = oneWeek.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;             ViewBag.TwoWeeks = twoWeeks.Count();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;             ViewBag.PctOneWeek = pctOneWeek;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;First, I added this to the About action of the HomeController.&amp;#160; It just grabs the issues, then collates the ones that are closed vs. the ones that are open, and runs some quick analysis.&lt;/p&gt;

&lt;p&gt;Heading over to the View, we added this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Issue Tracker Snap-Shot&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Total Issues Logged&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@ViewBag.CountAllIssues&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Closed Issues&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@ViewBag.CountClosedIssues&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Open Issues&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@ViewBag.CountOpenIssues&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;h3&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Issue Closure Details&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;h3&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Issues Closed In One Week or Less&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@ViewBag.OneWeek&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Percent Issues Closed in One Week&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@ViewBag.PctOneWeek&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum28"&gt;  28:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum29"&gt;  29:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum30"&gt;  30:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Issues Open More than Two Weeks&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;b&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum31"&gt;  31:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@ViewBag.TwoWeeks&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum32"&gt;  32:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum33"&gt;  33:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;And that’s really all it took.&lt;/p&gt;

&lt;p&gt;The Percentage part was kind of tricky, though: since there are no closed issues (as might actually happen in the first several days to couple of weeks if this were ever someone’s actual ticket tracking system) the Percentage wanted to return NaN.&amp;#160; So I created a little extension method off of Double:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; public static double PercentOf(this double numerator, double denominator)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;             var temp = numerator / denominator;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;             if (Double.NaN.CompareTo(temp) == 0) return 0;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;             return temp;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;It just goes ahead and divides anyway, and if the result returns NaN, it passes back 0.&amp;#160; Not mathematically accurate, but business accurate.&lt;/p&gt;

&lt;p&gt;Next, I turned to the WorkNote.&amp;#160; Specifically, I turned to making the edit a little more accurate, and linking it to the Issue.&amp;#160; I modified the controller and view to handle the LoggedDate automatically, and then I modified the Detail view of the Issue to provide a list of WorkNotes and the ability to add a new one.&amp;#160; Like So:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;fieldset&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;thead&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;th&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Work Detail&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;th&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;th&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Entered By&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;th&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;th&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Date&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;th&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;thead&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tbody&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;    @foreach (var item in Model.WorkNotes)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@item.Detail&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@item.UserId&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;          &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;@item.LoggedDate.ToShortDateString()&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;td&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tr&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;tbody&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;table&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     @Html.ActionLink(&amp;quot;Add Notes&amp;quot;, &amp;quot;Create&amp;quot;, &amp;quot;WorkNote&amp;quot;) |&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;     @Html.ActionLink(&amp;quot;Edit&amp;quot;, &amp;quot;Edit&amp;quot;, new { id=Model.IssueId }) |&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;     @Html.ActionLink(&amp;quot;Back to List&amp;quot;, &amp;quot;Index&amp;quot;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;p&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;So, now, when we navigate to the detail of an issue, we get:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-e1osrvH9Xus/TeguQEVvruI/AAAAAAAAADc/WvSaq4AlP-o/s1600-h/image%25255B8%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/-GOJA0HnOCDY/TeguQpOArZI/AAAAAAAAADg/xi5mbi0jYvw/image_thumb%25255B4%25255D.png?imgmax=800" width="400" height="592" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And clicking on the “Add Notes” link gives us:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-IACsL95gKYQ/TeguQ2EGYaI/AAAAAAAAADk/k9Rb3D-pOyA/s1600-h/image%25255B13%25255D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-P83Yevo2aSE/TeguRI7JQTI/AAAAAAAAADo/6hNMew0wJZo/image_thumb%25255B7%25255D.png?imgmax=800" width="410" height="545" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Currently, when we add a new note, it takes us to the WorkNotes Index… we’ll work on that for the next post.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-8010229825432747004?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/8010229825432747004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-part-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8010229825432747004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8010229825432747004'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-part-3.html' title='MVC Issue Tracker: Part 3'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-R949HO2HyJ0/TeguP4Ro7JI/AAAAAAAAADY/ruCtOtdqQF8/s72-c/image_thumb%25255B1%25255D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6757104423076752295</id><published>2011-06-02T16:12:00.000-05:00</published><updated>2011-06-02T16:12:09.348-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coding 201'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC Issue Tracker'/><title type='text'>MVC Issue Tracker: Ancillary Issues</title><content type='html'>A more substantive post on the Issue Tracker should be up tonight or tomorrow (if I can get WLW to connect...) but for I wanted to mention a couple of things I ran into today just so I don't forget them.&lt;br /&gt;
&lt;br /&gt;
While doing some view updates, I ran into two issues: first: Remember that DateTime? needs to be cast to DateTime (or .Value needs to be retrieved) to do any DateAdd functions (the reasons for this are apparent when you think about them, but there you go...).&amp;nbsp; Second, I really wish Microsoft would just bow to reality and implement a C# Language version of IEnumerable&lt;t&gt;.ForEach. &amp;nbsp;&lt;/t&gt;&lt;br /&gt;
&lt;br /&gt;
I've read &lt;a href="http://blogs.msdn.com/ericlippert/archive/2009/05/18/foreach-vs-foreach.aspx"&gt;Eric Lippert's post on the issue&lt;/a&gt; and, while I understand what he's saying, I largely disagree.&amp;nbsp; It may be "philosophical" to say that ".ForEach" would just provide "a side effect," but how many times do you find yourself writing this code:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Stuff is an IEnumerable&lt;thingy&gt;&lt;/thingy&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach(var thingy in Stuff) { if(thingy.parameter == value) doSomething(thingy); }&lt;br /&gt;
&lt;br /&gt;
or this:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Stuff.ToList().ForEach(t =&amp;gt; {if(t.parameter == value) doSomething(t)});&lt;br /&gt;
&lt;br /&gt;
Now, to my mind, neither of these is particularly hard to read, but, in both cases, I'm having to type more than I'd like to.&amp;nbsp; My preferred method would be:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Stuff.ForEach(t =&amp;gt; {if(t.parameter == value) doSomething(t)});&lt;br /&gt;
&lt;br /&gt;
Even more useful, to my mind, is a way to handle "null" elegantly.&amp;nbsp; I work with user input on a fairly regular basis, and sometimes users end up entering null values.&amp;nbsp; Now- let it be said- the correct thing to do is to check to see if something is null BEFORE adding it to a collection.&amp;nbsp; However, that doesn't always happen, and we should be able to handle it.&amp;nbsp; So, I implemented my own SafeForEach as an extension method for IEnumerable&lt;t&gt;.&amp;nbsp; I'll post the code for that with my main post later.&lt;/t&gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we come to another minor annoyance: Percentages- especially "of" 0.&amp;nbsp; In the Issue Tracker, I'll be providing a Snap-Shot that provides a statistic for "Percent of Issues Closed in One Week Or Less."&amp;nbsp; However, right now, I have no issues closed- so how can there be a percentage of 0?&amp;nbsp; Now, I could define my percentage as closedInOneWeekOrLess/totalIssues, but that's not the metric I'm looking for (though it could be a useful metric to track, now that I think about it).&amp;nbsp; I want the percentage of closed issues which were closed in one week or less.&amp;nbsp; Until there are closed issues, however, there is no good way to provide that percentage.&lt;br /&gt;
&lt;br /&gt;
So, on Double, I wrote another ExtensionMethod (also a good way to express exactly what you want better than just doing the math in code: .PercentageOf(double denominator).&amp;nbsp; This is defined as "public static double PercentageOf(this double numerator, double denominator).&amp;nbsp; It then does the math, and returns 0 instead of NaN when NaN would be provided.&lt;br /&gt;
&lt;br /&gt;
The code for both of these methods will be provided either as an update/edit to this post, or in the main post which should come tonight or tomorrow.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6757104423076752295?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6757104423076752295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-ancillary-issues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6757104423076752295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6757104423076752295'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/06/mvc-issue-tracker-ancillary-issues.html' title='MVC Issue Tracker: Ancillary Issues'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6077307992748655906</id><published>2011-05-27T17:00:00.000-05:00</published><updated>2011-05-27T17:00:22.185-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Generic Serialization</title><content type='html'>&lt;span xmlns=""&gt;Another side post, while I also work on the MVC application.&lt;br /&gt;
&lt;br /&gt;
One of the things I deal with on a regular basis is serialization of objects to and from files.   Additionally, I see the questions come up on StackOverflow from time to time.  So, to save myself some time and effort, and, hopefully, to help educate others, I wrote a generic serialization .dll.&lt;br /&gt;
&lt;br /&gt;
The project is very small at the moment, though I may expand it as I decide to explore other types of Streams.  Right now, it is strictly file serialization/deserialization.  The over-arching idea is the ISerializer interface which defines two methods: Serialize and Deserialize.  Then each class will implement that interface.  The reason I used an interface is that I really do plan to expand this code and use it out in the wild.  For that reason, I need to be able to serialize to whatever Stream type is appropriate at the moment, but I need to de-couple the serialization from the objects, as well as the presentation and business layers, as possible.&lt;br /&gt;
&lt;br /&gt;
So, on to the code.&lt;br /&gt;
&lt;br /&gt;
As I said, I started with a simple Interface: ISerializer:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 10pt;"&gt;namespace&lt;span style="color: black;"&gt;&amp;nbsp;GenericSerializer &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;interface&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;ISerializer&lt;span style="color: black;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;Serialize&amp;lt;T&amp;gt;(T&amp;nbsp;target); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T&amp;nbsp;Deserialize&amp;lt;T&amp;gt;(); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Notice the use of the T type designator.  I want this completely generic so that ANY class which is decorated as [Serializable] will work with my code.  This won't do any custom serialization, but I've never found that much need for it.&lt;br /&gt;
&lt;br /&gt;
Now, my two classes: GenericXmlSerializer and GenericBinarySerializer.  Again, both of these serialize only to files, at the moment.  That will probably change in the future.&lt;br /&gt;
&lt;br /&gt;
Here is the Xml Serializer:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 10pt;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GenericXmlSerializer&lt;span style="color: black;"&gt;&amp;nbsp;:&amp;nbsp;&lt;span style="color: #2b91af;"&gt;ISerializer&lt;span style="color: black;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;Path&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;GenericXmlSerializer()&amp;nbsp;{&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;GenericXmlSerializer(&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;path) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Path&amp;nbsp;=&amp;nbsp;path; &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;Serialize&amp;lt;T&amp;gt;(T&amp;nbsp;target) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;&amp;nbsp;fs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.Path,&amp;nbsp;FileMode.Create)) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;&amp;nbsp;xs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;typeof&lt;span style="color: black;"&gt;(T)); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xs.Serialize(fs,&amp;nbsp;target); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;T&amp;nbsp;Deserialize&amp;lt;T&amp;gt;() &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T&amp;nbsp;result; &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;&amp;nbsp;fs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.Path,&amp;nbsp;FileMode.Open)) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;&amp;nbsp;xs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;typeof&lt;span style="color: black;"&gt;(T)); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;=&amp;nbsp;(T)xs.Deserialize(fs); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;span style="color: black;"&gt;&amp;nbsp;result; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
I elected to have a Path property because I have to have an instance anyway.  So we may as well ask for the path to which a file will be serialized at the time of class instantiation.  Also note that the serialization code itself is very, very basic.  I just use the default settings of XmlSerializer to write out the file.  Deserialization is the same, I'm presuming the type T will be defined such that basic deserialization will be okay.  If it isn't, of course, I'll have a problem.  But this code wasn't designed to handle custom serialization anyway, so I'm not terribly concerned.&lt;br /&gt;
&lt;br /&gt;
I made the same decisions with the Binary Serializer:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 10pt;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GenericBinarySerializer&lt;span style="color: black;"&gt;&amp;nbsp;:&amp;nbsp;&lt;span style="color: #2b91af;"&gt;ISerializer&lt;span style="color: black;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;Path&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;GenericBinarySerializer()&amp;nbsp;{&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;GenericBinarySerializer(&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;path) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Path&amp;nbsp;=&amp;nbsp;path; &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;Serialize&amp;lt;T&amp;gt;(T&amp;nbsp;target) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;&amp;nbsp;fs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.Path,&amp;nbsp;FileMode.Create)) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;BinaryFormatter&lt;span style="color: black;"&gt;&amp;nbsp;bf&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;BinaryFormatter&lt;span style="color: black;"&gt;(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bf.Serialize(fs,&amp;nbsp;target); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;T&amp;nbsp;Deserialize&amp;lt;T&amp;gt;() &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T&amp;nbsp;result; &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;&amp;nbsp;fs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;FileStream&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.Path,&amp;nbsp;FileMode.Open)) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;BinaryFormatter&lt;span style="color: black;"&gt;&amp;nbsp;bf&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;BinaryFormatter&lt;span style="color: black;"&gt;(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result&amp;nbsp;=&amp;nbsp;(T)bf.Deserialize(fs); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;span style="color: black;"&gt;&amp;nbsp;result; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Now, we have our serializers, but do they work?  The only way to know is to set up another project which uses them.  In this case, I'll use the same solution, but a new project.  In the wild, of course, we'll be using different solutions with references to the .dll.&lt;br /&gt;
&lt;br /&gt;
So, SampleSerializationProject: It has a Class: Employee, an Enum: WorkRole, and a simple console application that will put together a couple of files for us.&lt;br /&gt;
&lt;br /&gt;
The Employee Class:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;[&lt;span style="color: #2b91af;"&gt;Serializable&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;class&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;           &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;int&lt;span style="color: black;"&gt;&amp;nbsp;EmployeeId&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;LastName&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;FirstName&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;XmlEnum&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;private&lt;span style="color: black;"&gt;&amp;nbsp;WorkRole&amp;nbsp;role; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;WorkRole&amp;nbsp;Role &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;span style="color: black;"&gt;&amp;nbsp;role;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;&amp;nbsp;{&amp;nbsp;role&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;value&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;double&lt;span style="color: black;"&gt;&amp;nbsp;Salary&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;bool&lt;span style="color: black;"&gt;&amp;nbsp;Exempt&amp;nbsp;{&amp;nbsp;&lt;span style="color: blue;"&gt;get&lt;span style="color: black;"&gt;;&amp;nbsp;&lt;span style="color: blue;"&gt;set&lt;span style="color: black;"&gt;;&amp;nbsp;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;override&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;&amp;nbsp;ToString() &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;return&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;.Format(&lt;span style="color: #a31515;"&gt;"Employee&amp;nbsp;Id:&amp;nbsp;{0}&amp;nbsp;::&amp;nbsp;{1},&amp;nbsp;{2}"&lt;span style="color: black;"&gt;,&amp;nbsp;EmployeeId,&amp;nbsp;LastName,&amp;nbsp;FirstName); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Note that the WorkRole could not be represented as an automatically implemented property, I had to specify the backing field to use the [XmlEnum] attribute.&lt;br /&gt;
&lt;br /&gt;
The WorkRole Enum:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style="color: #2b91af;"&gt;Flags&lt;span style="color: black;"&gt;()] &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;enum&lt;span style="color: black;"&gt;&amp;nbsp;WorkRole &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Clerk, &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Laborer, &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Manager, &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Officer &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Here, note the [Flags()] attribute.  This allows the binary formatter to serialize to and from the enum in the same way that [XmlEnum] allows the XmlSerializer to do so.&lt;br /&gt;
&lt;br /&gt;
Finally, the program itself:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 10pt;"&gt;static&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;Main(&lt;span style="color: blue;"&gt;string&lt;span style="color: black;"&gt;[]&amp;nbsp;args) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;var&lt;span style="color: black;"&gt;&amp;nbsp;Employees&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;()&amp;nbsp;{EmployeeId&amp;nbsp;=&amp;nbsp;1,&amp;nbsp;LastName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Smith"&lt;span style="color: black;"&gt;,&amp;nbsp;FirstName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"John"&lt;span style="color: black;"&gt;,&amp;nbsp;Role&amp;nbsp;=&amp;nbsp;WorkRole.Clerk,&amp;nbsp;Salary&amp;nbsp;=&amp;nbsp;10.00,&amp;nbsp;Exempt&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;false&lt;span style="color: black;"&gt;}, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;()&amp;nbsp;{EmployeeId&amp;nbsp;=&amp;nbsp;2,&amp;nbsp;LastName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Doe"&lt;span style="color: black;"&gt;,&amp;nbsp;FirstName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Jane"&lt;span style="color: black;"&gt;,&amp;nbsp;Role&amp;nbsp;=&amp;nbsp;WorkRole.Laborer,&amp;nbsp;Salary&amp;nbsp;=&amp;nbsp;15.00,&amp;nbsp;Exempt&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;false&lt;span style="color: black;"&gt;}, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;()&amp;nbsp;{EmployeeId&amp;nbsp;=&amp;nbsp;3,&amp;nbsp;LastName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Zachary"&lt;span style="color: black;"&gt;,&amp;nbsp;FirstName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Marcus"&lt;span style="color: black;"&gt;,&amp;nbsp;Role&amp;nbsp;&amp;nbsp;=&amp;nbsp;WorkRole.Manager,&amp;nbsp;Salary&amp;nbsp;=&amp;nbsp;50000.00,&amp;nbsp;Exempt&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;true&lt;span style="color: black;"&gt;}, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;()&amp;nbsp;{EmployeeId&amp;nbsp;=&amp;nbsp;4,&amp;nbsp;LastName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Goodner"&lt;span style="color: black;"&gt;,&amp;nbsp;FirstName&amp;nbsp;=&amp;nbsp;&lt;span style="color: #a31515;"&gt;"Allen"&lt;span style="color: black;"&gt;,&amp;nbsp;Role&amp;nbsp;=&amp;nbsp;WorkRole.Officer,&amp;nbsp;Salary&amp;nbsp;=&amp;nbsp;80000.00,&amp;nbsp;Exempt&amp;nbsp;=&lt;span style="color: blue;"&gt;true&lt;span style="color: black;"&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}; &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GenericXmlSerializer&lt;span style="color: black;"&gt;&amp;nbsp;gxs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GenericXmlSerializer&lt;span style="color: black;"&gt;(&lt;span style="color: #a31515;"&gt;@"C:\Testing\testXmlSerialization.xml"&lt;span style="color: black;"&gt;); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GenericBinarySerializer&lt;span style="color: black;"&gt;&amp;nbsp;gbs&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GenericBinarySerializer&lt;span style="color: black;"&gt;(&lt;span style="color: #a31515;"&gt;@"C:\Testing\testBinarySerialization.dat"&lt;span style="color: black;"&gt;); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gxs.Serialize&amp;lt;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;&amp;gt;&amp;gt;(Employees); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gbs.Serialize&amp;lt;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;&amp;gt;&amp;gt;(Employees); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Employees&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;null&lt;span style="color: black;"&gt;; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;&amp;gt;&amp;nbsp;Employees2; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Employees&amp;nbsp;=&amp;nbsp;gxs.Deserialize&amp;lt;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;&amp;gt;&amp;gt;(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Employees2&amp;nbsp;=&amp;nbsp;gbs.Deserialize&amp;lt;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;span style="color: black;"&gt;&amp;gt;&amp;gt;(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;span style="color: black;"&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Output&amp;nbsp;from&amp;nbsp;Xml&amp;nbsp;Deserialization"&lt;span style="color: black;"&gt;); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Employees.ForEach(e&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;span style="color: black;"&gt;.WriteLine(e)); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;span style="color: black;"&gt;.WriteLine(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;span style="color: black;"&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Output&amp;nbsp;from&amp;nbsp;Binary&amp;nbsp;Deserialization"&lt;span style="color: black;"&gt;); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Employees2.ForEach(e&amp;nbsp;=&amp;gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;span style="color: black;"&gt;.WriteLine(e)); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Console&lt;span style="color: black;"&gt;.ReadKey(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Here you see I'm creating a List of Type: Employee.  I then create two generic serializers (one for each type I built) and provide the path I where I want the files to go.  I Serialize to disk, then I null out the first list and create a second- just to prove that both types worked.  I deserialize from both files, and then write the output to the Console.&lt;br /&gt;
&lt;br /&gt;
Please, feel free to copy this code to your heart's content.  If anyone needs me to, I'll happily post the compiled .dll on Codeplex. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6077307992748655906?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6077307992748655906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/generic-serialization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6077307992748655906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6077307992748655906'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/generic-serialization.html' title='Generic Serialization'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-869173463204479310</id><published>2011-05-26T13:46:00.002-05:00</published><updated>2011-05-26T13:48:08.143-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC3'/><category scheme='http://www.blogger.com/atom/ns#' term='MVC Issue Tracker'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>MVC Issue Tracker: Part 2</title><content type='html'>&lt;strong&gt;Apologies for the delay: But, I’m back in business now, so we’ll pick up where we left off…&lt;/strong&gt;&lt;br /&gt;
Before we can begin with our Controllers, we need to finish one part of the data model: the Database Context.&lt;br /&gt;
Entity Framework makes this easy for us, in MVC3.&amp;nbsp; First, we add a new connection string&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="IssueTrackerDbContext"&lt;/span&gt;
         &lt;span class="attr"&gt;connectionString&lt;/span&gt;&lt;span class="kwrd"&gt;="Data Source=|DataDirectory|IssueTrackerDb.sdf"&lt;/span&gt;
         &lt;span class="attr"&gt;providerName&lt;/span&gt;&lt;span class="kwrd"&gt;="System.Data.SqlServerCe.4.0"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
Then, we add a new folder under our Models folder.&amp;nbsp; I just called it “Data.”&amp;nbsp; To this folder, we’ll add two classes: IssueTrackerDbContext is our context class.&lt;br /&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; IssueTrackerDbContext : DbContext
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; DbSet&amp;lt;Issue&amp;gt; Issues { get; set; }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; DbSet&amp;lt;WorkNote&amp;gt; WorkNotes { get; set; }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; DbSet&amp;lt;User&amp;gt; Users { get; set; }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnModelCreating
            (DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions
               .Remove&amp;lt;PluralizingTableNameConvention&amp;gt;();
        }
    }&lt;/pre&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
This just sets up our entities for our Controllers.&amp;nbsp; Now, so that we’ll have data to play with as we make other changes, we add the IssueTrackerInitializer.&lt;br /&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Seed(IssueTrackerDbContext context)&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;var Users = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;User&amp;gt;&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;new&lt;/span&gt; User() &lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class="alt"&gt;UserName = &lt;span class="str"&gt;"Agoodner"&lt;/span&gt;, &lt;/pre&gt;&lt;pre&gt;LastName = &lt;span class="str"&gt;"Goodner"&lt;/span&gt;, &lt;/pre&gt;&lt;pre class="alt"&gt;FirstName = &lt;span class="str"&gt;"Allen"&lt;/span&gt;, &lt;/pre&gt;&lt;pre&gt;Password = &lt;span class="str"&gt;"dontdothis"&lt;/span&gt;, &lt;/pre&gt;&lt;pre class="alt"&gt;Role = Role.Administrator&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class="alt"&gt;};&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;Users.ForEach(u =&amp;gt; context.Users.Add(u));&lt;/pre&gt;&lt;pre&gt;context.SaveChanges();&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;var issues = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Issue&amp;gt;&lt;/pre&gt;&lt;pre class="alt"&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;new&lt;/span&gt; Issue() &lt;/pre&gt;&lt;pre class="alt"&gt;{ &lt;/pre&gt;&lt;pre&gt;Title = &lt;span class="str"&gt;"Sample"&lt;/span&gt;, &lt;/pre&gt;&lt;pre class="alt"&gt;Description = &lt;span class="str"&gt;"A Samle issue."&lt;/span&gt;, &lt;/pre&gt;&lt;pre&gt;CreatedBy = 1, &lt;/pre&gt;&lt;pre class="alt"&gt;CreatedDate = DateTime.Now, &lt;/pre&gt;&lt;pre&gt;AssignedTo = 1, &lt;/pre&gt;&lt;pre class="alt"&gt;AssignedUser = Users[0] &lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class="alt"&gt;};&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;issues.ForEach(i =&amp;gt; context.Issues.Add(i));&lt;/pre&gt;&lt;pre&gt;context.SaveChanges();&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;var WorkNotes = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;WorkNote&amp;gt;&lt;/pre&gt;&lt;pre class="alt"&gt;{&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;new&lt;/span&gt; WorkNote() &lt;/pre&gt;&lt;pre class="alt"&gt;{ &lt;/pre&gt;&lt;pre&gt;IssueId = 1, &lt;/pre&gt;&lt;pre class="alt"&gt;UserId = 1,&lt;/pre&gt;&lt;pre&gt;Detail = &lt;span class="str"&gt;"A Sample Note on a sample issue."&lt;/span&gt;, &lt;/pre&gt;&lt;pre class="alt"&gt;LoggedDate = DateTime.Now, &lt;/pre&gt;&lt;pre&gt;AttachedIssue = issues[0]&lt;/pre&gt;&lt;pre class="alt"&gt;},&lt;/pre&gt;&lt;pre&gt;&lt;span class="kwrd"&gt;new&lt;/span&gt; WorkNote() &lt;/pre&gt;&lt;pre class="alt"&gt;{ &lt;/pre&gt;&lt;pre&gt;IssueId = 1, &lt;/pre&gt;&lt;pre class="alt"&gt;UserId = 1,&lt;/pre&gt;&lt;pre&gt;Detail = &lt;span class="str"&gt;"Another Sample Note on a sample issue"&lt;/span&gt;, &lt;/pre&gt;&lt;pre class="alt"&gt;LoggedDate = DateTime.Now, AttachedIssue = issues[0]&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;pre class="alt"&gt;};&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;WorkNotes.ForEach(w =&amp;gt; context.WorkNotes.Add(w));&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;var wnIssue = context.Issues.Where(i =&amp;gt; i.IssueId == 1).Single();&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;WorkNotes.ForEach(w =&amp;gt; wnIssue.WorkNotes.Add(w));&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;context.SaveChanges();&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
This will allow us to have some sample data when we first initialize&amp;nbsp; the application.&lt;br /&gt;
Now we can begin on our controllers.&amp;nbsp; We’ll start with an Issue Controller.&amp;nbsp; Whereas I skipped [Class]Model naming convention with the Models, I’ll leave the ‘Controler’ portion on our controllers.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/-zqzZU8LIfEg/Td6f4rH3uCI/AAAAAAAAAC0/b0aa0Agbhk4/s1600-h/CropperCapture23.jpg"&gt;&lt;img alt="CropperCapture[2]" border="0" height="262px" src="http://lh6.ggpht.com/-wYhJhNTrXc8/Td6f5HGTuyI/AAAAAAAAAC4/K01SbXCzdbo/CropperCapture2_thumb1.jpg?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="CropperCapture[2]" width="394px" /&gt;&lt;/a&gt; &lt;br /&gt;
For now, we’ll leave the Controller as we find it, but we will update the views.&amp;nbsp; First, the Index:&lt;br /&gt;
Most of our changes are cosmetic: Thus:&lt;br /&gt;
&lt;pre class="csharpcode"&gt;@model IEnumerable&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;MvcIssueTracker.Models.Issue&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

@{
    ViewBag.Title = "Index";
}

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Open Issues&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    @Html.ActionLink("Create New", "Create")
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Title
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Detailed Description
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Created By
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Created Date
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Assigned To
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Last Updated Date
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Closed By
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            Closed Date
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;th&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;We changed the &amp;lt;h2&amp;gt; heading to “Open Issues” and we modified the column header names so they look a little more friendly.&lt;br /&gt;
The only thing of substance we did was to make the view aware of if an issue is closed or not:&lt;br /&gt;
&lt;pre class="csharpcode"&gt;@foreach (var item in Model) {
    if (item.ClosedDate == null)
    { 
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.Title)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.Description)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.CreatedBy)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.CreatedDate)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.AssignedTo)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.LastUpdatedDate)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.ClosedBy)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.DisplayFor(modelItem =&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; item.ClosedDate)
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            @Html.ActionLink("Edit", "Edit", new { id = item.IssueId }) |
            @Html.ActionLink("Details", "Details", new { id = item.IssueId }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.IssueId })
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    }&lt;/pre&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: consolas, "Courier New", courier, monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;Now, with the controller and view in place, we run the app and navigate to /Issue… &lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/-rJm1SrCmKl0/Td6f5Q-GlYI/AAAAAAAAAC8/tzKH0HKGDpY/s1600-h/CropperCapture%25255B3%25255D%25255B4%25255D.jpg"&gt;&lt;img alt="CropperCapture[3]" border="0" height="254px" src="http://lh4.ggpht.com/--mwkC3qjDUc/Td6f5goLayI/AAAAAAAAADA/t15Wx5CYu30/CropperCapture%25255B3%25255D_thumb%25255B2%25255D.jpg?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="CropperCapture[3]" width="432px" /&gt;&lt;/a&gt; &lt;br /&gt;
Similar work to the User Controller generates:&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/-I1kNHNKDuSU/Td6f597fLLI/AAAAAAAAADE/TWcYPzdM50U/s1600-h/CropperCapture%25255B4%25255D%25255B3%25255D.jpg"&gt;&lt;img alt="CropperCapture[4]" border="0" height="261px" src="http://lh4.ggpht.com/-X1UoyuTL4Gs/Td6f6KE55WI/AAAAAAAAADI/6vgK55YlueU/CropperCapture%25255B4%25255D_thumb%25255B1%25255D.jpg?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="CropperCapture[4]" width="443px" /&gt;&lt;/a&gt; &lt;br /&gt;
And with the WorkNote Controller produces: &lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/-bA7wcr3M9SA/Td6f6ZvsycI/AAAAAAAAADM/SS3gSnk977w/s1600-h/CropperCapture%25255B5%25255D%25255B4%25255D.jpg"&gt;&lt;img alt="CropperCapture[5]" border="0" height="270px" src="http://lh5.ggpht.com/-wie_yNJugSU/Td6f6v-IheI/AAAAAAAAADQ/GZcuyI1Tn3A/CropperCapture%25255B5%25255D_thumb%25255B2%25255D.jpg?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;" title="CropperCapture[5]" width="453px" /&gt;&lt;/a&gt; &lt;br /&gt;
We’ll stop there, for now.&amp;nbsp; Between this post and next, I’ll clean up those views, and hook up the Issue to the WorkNotes…&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-869173463204479310?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/869173463204479310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/mvc-issue-tracker-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/869173463204479310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/869173463204479310'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/mvc-issue-tracker-part-2.html' title='MVC Issue Tracker: Part 2'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/-wYhJhNTrXc8/Td6f5HGTuyI/AAAAAAAAAC4/K01SbXCzdbo/s72-c/CropperCapture2_thumb1.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-5333963947274041869</id><published>2011-05-17T21:40:00.001-05:00</published><updated>2011-05-19T11:33:17.094-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coding 201'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Coding 201 – Separating your Code Layers</title><content type='html'>&lt;span xmlns=""&gt;&lt;b&gt;Above the Post Edit:&lt;/b&gt; In response to a request, the source code is available on CodePlex @ http://movielibrarydemo.codeplex.com/ &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span xmlns=""&gt;&lt;b&gt;Original Post:&lt;/b&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span xmlns=""&gt;One thing that has come to annoy me recently is the fact that, despite how much we talk about it, we never show new developers how actually to go about separating their code tiers, or layers, from each other.  Then they get into some jam where good, object-oriented code would help, and they completely have to refactor. &lt;br /&gt;
Something like this came up today on StackOverflow.com (where I ask/answer as AllenG) when someone was building a simple library app to sort and store movies.&lt;br /&gt;
&lt;br /&gt;
As soon as I heard this, my brain said to me, "Self," it said, "If I were doing this, I'd have an object layer with a Movie object and a Library Object, and they'd both be Serializable.  Then I could just call an XmlSerializer and let it do the work."  Which is, more or less, what I said.  Unfortunately, the questioner did not understand how to go about making that happen.  Well, out of a sense of fun, I had thrown the same project together anyway, and was going to post something about it (Don't worry, my next installment for my MVC3 series is slated for Thursday, unless something comes up).  With his questions, I decided to go a little more into detail. &lt;br /&gt;
&lt;br /&gt;
So, first, even for small projects, I believe that code should be broken into all three tiers: data, logic, UI.  In very small projects, you could just manage it with folders, but I tend to use separate projects within a solution just to maintain the habit.&lt;br /&gt;
&lt;br /&gt;
So, I created a solution (sorry, no screen caps- I'm on a different computer at the moment) which I just called MyMovieLibrary.  The first project was a Class Library.  I used it to create the following classes: &lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;div&gt;Movie : Serializable &lt;/div&gt;&lt;ol&gt;&lt;li&gt;Title &lt;/li&gt;
&lt;li&gt;Genre (an enum) //I had to make this an old style field/property to get it serialize with the XmlEnum attribute &lt;/li&gt;
&lt;li&gt;MPAA Rating &lt;/li&gt;
&lt;li&gt;Running Time &lt;/li&gt;
&lt;li&gt;Personal Rating &lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;Library : Serializable &lt;/div&gt;&lt;ol&gt;&lt;li&gt;List&amp;lt;Movie&amp;gt; &lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;LibraryManager &lt;/div&gt;&lt;ol&gt;&lt;li&gt;Library &lt;/li&gt;
&lt;li&gt;Methods to use the Library's List&amp;lt;Movie&amp;gt;.  &lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;Then I created the Genre enum.&lt;br /&gt;
&lt;br /&gt;
If I were building it for real, I'd probably move most of the code from LibraryManager just into library, but there would be enough that I don't think the Library should know about that I'd still have all three classes.&lt;br /&gt;
&lt;br /&gt;
Once I had my classes, I created a new project in the same solution that I called WinMovieLibrary.  It referenced my class library project, and was a simple form.&lt;br /&gt;
&lt;br /&gt;
The big thing that the OP needed was how to make the list-view work.  So here that is, in all its glory (again, sorry for the formatting- I should be back on my main machine for the next MVC post…)&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: 10pt;"&gt;        public&lt;span style="color: black;"&gt;&amp;nbsp;Form1() &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InitializeComponent(); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;manager&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;LibraryManager&lt;span style="color: black;"&gt;(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;File&lt;span style="color: black;"&gt;.Exists(&lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;span style="color: black;"&gt;.AppSettings[&lt;span style="color: #a31515;"&gt;"SaveLocation"&lt;span style="color: black;"&gt;])) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;manager.Load(); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;else&lt;span style="color: black;"&gt;&amp;nbsp;manager.Library&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Library&lt;span style="color: black;"&gt;()&amp;nbsp;{&amp;nbsp;Movies&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;List&lt;span style="color: black;"&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Movie&lt;span style="color: black;"&gt;&amp;gt;()&amp;nbsp;}; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.movieList.DataSource&amp;nbsp;=&amp;nbsp;manager.Library.Movies; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
As you can see, this is the Form initializer.  You see that it calls an already saved file (if it exists) and loads the records into the library.  Then, even if there are no movies, yet, it sets the DataSource of the ListBox to manager.Library.Movies.&lt;br /&gt;
&lt;br /&gt;
When I update the library (say, by adding or deleting a movie), I then call this code:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;private&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;UpdateMovieListBox() &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.SuspendLayout(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;movieList.Invalidate(); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;movieList.DataSource&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;null&lt;span style="color: black;"&gt;; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;movieList.DataSource&amp;nbsp;=&amp;nbsp;manager.Library.Movies; &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;this&lt;span style="color: black;"&gt;.Update(); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
This suspends the layout of the form, invalidates the movieList control, and then forces the DataSource to update.  Finally, I allow the form to update.  Which then gets me whatever the current version of the list is. &lt;br /&gt;
For serialization (where this started), as I mentioned, I simply marked up the Library and Movie classes as [Serializable], and my LibraryManager actually serializes them with this code (Save first, then Load):&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;Save() &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;XmlWriter&lt;span style="color: black;"&gt;&amp;nbsp;xWriter&amp;nbsp;=&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlWriter&lt;span style="color: black;"&gt;.Create(&lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;span style="color: black;"&gt;.AppSettings[&lt;span style="color: #a31515;"&gt;"SaveLocation"&lt;span style="color: black;"&gt;])) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;&amp;nbsp;xSer&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;typeof&lt;span style="color: black;"&gt;(&lt;span style="color: #2b91af;"&gt;Library&lt;span style="color: black;"&gt;)); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;xSer.Serialize(xWriter,&amp;nbsp;Library); &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;void&lt;span style="color: black;"&gt;&amp;nbsp;Load() &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;using&lt;span style="color: black;"&gt;&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;XmlReader&lt;span style="color: black;"&gt;&amp;nbsp;xReader&amp;nbsp;=&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlReader&lt;span style="color: black;"&gt;.Create(&lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;span style="color: black;"&gt;.AppSettings[&lt;span style="color: #a31515;"&gt;"SaveLocation"&lt;span style="color: black;"&gt;])) &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;&amp;nbsp;xSer&amp;nbsp;=&amp;nbsp;&lt;span style="color: blue;"&gt;new&lt;span style="color: black;"&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;XmlSerializer&lt;span style="color: black;"&gt;(&lt;span style="color: blue;"&gt;typeof&lt;span style="color: black;"&gt;(&lt;span style="color: #2b91af;"&gt;Library&lt;span style="color: black;"&gt;)); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Library&amp;nbsp;=&amp;nbsp;(&lt;span style="color: #2b91af;"&gt;Library&lt;span style="color: black;"&gt;)xSer.Deserialize(xReader); &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;div style="background: none repeat scroll 0% 0% white;"&gt;&lt;span style="color: black; font-family: Consolas; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Now, back to my original point.  Something I've noticed (and I've noticed it in everything from instructional books to tutorials online, to college level classes) is that we do not teach new developers this simple, foundational stuff.  Had the OP known, from the beginning, that Movie should have been a class, and that his ListBox should just attach to a list for a DataSource, then his confusion over Serialization would not have required (probably) a question on SO followed by an exchange of comments.  Even if he'd had to ask his question, as soon as someone said "Make your object serializable, then call an XmlSerializer" he'd have been all set.&lt;br /&gt;
&lt;br /&gt;
So, for those of you who teach others how to write code, please incorporate this fundamental into your training material.  It's not that hard to do, and it can save someone much time when they find they need to add functionality they hadn't thought of.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-5333963947274041869?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/5333963947274041869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/coding-201-separating-your-code-layers.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/5333963947274041869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/5333963947274041869'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/coding-201-separating-your-code-layers.html' title='Coding 201 – Separating your Code Layers'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-9189053655531122949</id><published>2011-05-15T21:34:00.001-05:00</published><updated>2011-05-15T21:34:37.396-05:00</updated><title type='text'>Issue Tracker: Setting Up</title><content type='html'>&lt;p&gt;To set up the project, I simply selected a New Project, selected ASP MVC 3 from the Web templates, renamed, and clicked OK.&amp;#160; That brought up the ASP MVC3 Dialog, where I selected an Internet Application, Razor view syntax, and did not choose to enable HTML 5 semantics.&lt;/p&gt;  &lt;p&gt;That got me this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_NInAQbKhxFA/TdCNOp45cyI/AAAAAAAAACs/7CNlAMIRX48/s1600-h/CropperCapture%5B1%5D%5B4%5D.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CropperCapture[1]" border="0" alt="CropperCapture[1]" src="http://lh5.ggpht.com/_NInAQbKhxFA/TdCNPKcAW2I/AAAAAAAAACw/Sj8GWbjvhMw/CropperCapture%5B1%5D_thumb%5B2%5D.jpg?imgmax=800" width="286" height="356" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A basic Website Set up.&amp;#160; If I run it, it says, essentially, “Hello World.”&lt;/p&gt;  &lt;p&gt;Right-click the solution and select “Add Solution to Source Control” and it’s even on &lt;a href="http://mvcissuetrackerdemo.codeplex.com/"&gt;CodePlex&lt;/a&gt; for me.&lt;/p&gt;  &lt;p&gt;That done, it’s time to move onto the models.&amp;#160; As I said before, we’ll have 3 table entities- Issues, Work Notes, and Users, and an enum value for Role.&amp;#160; So, first off, an Issue class…&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data.Entity;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MvcIssueTracker.Models&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Issue&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; IssueId { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        [Required(ErrorMessage=&lt;span class="str"&gt;&amp;quot;A Title is required.&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        [StringLength(100, MinimumLength=15)]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Title { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        [Required(ErrorMessage=&lt;span class="str"&gt;&amp;quot;A Detailed Description is required.&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Description { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; CreatedBy { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; DateTime CreatedDate { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; AssignedTo { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; DateTime? LastUpdatedDate { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; ClosedBy { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; DateTime? ClosedDate { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;virtual&lt;/span&gt; User AssignedUser { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;virtual&lt;/span&gt; ICollection&amp;lt;WorkNote&amp;gt; WorkNotes { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Note that I dispensed with the convention of calling it “IssueModel.”&amp;#160; It’s in the Model folder (and, therefore, the MvcIssueTracker.Models namespace).&amp;#160; I went ahead and added my data notations as well, since I’ll need them eventually anyway.&lt;/p&gt;

&lt;p&gt;One down, two (and a half?) to go.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MvcIssueTracker.Models&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; WorkNote&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; WorkNoteId { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        [Required(ErrorMessage = &lt;span class="str"&gt;&amp;quot;Details are required.&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Detail { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; DateTime LoggedDate { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; IssueId { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;virtual&lt;/span&gt; Issue AttachedIssue { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data.Entity;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MvcIssueTracker.Models&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; User&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; UserId { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;        [Required(ErrorMessage = &lt;span class="str"&gt;&amp;quot;UserName is required.&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; UserName { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LastName { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Location { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Password { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Role Role { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;virtual&lt;/span&gt; ICollection&amp;lt;Issue&amp;gt; AssignedIssues { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;And, finally, the Roles enum:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MvcIssueTracker.Models&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;enum&lt;/span&gt; Role&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        User, &lt;span class="rem"&gt;//The base user- able only to create issues and add worknotes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        Developer, &lt;span class="rem"&gt;//User functionality + close issues&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        Manager, &lt;span class="rem"&gt;//Same functionality as Developer- listed differently for audit type purposes&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        Administrator, &lt;span class="rem"&gt;//Developer + Delete issues&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;So, a quick Save All, and a Build to make sure nothing obvious is immediately broken… And we’re done.&amp;#160; A set of classes for our data model.&amp;#160; &lt;/p&gt;

&lt;p&gt;In the next installment, we’ll look at getting the DataContext set up, and begin building controllers and views.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-9189053655531122949?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/9189053655531122949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/issue-tracker-setting-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/9189053655531122949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/9189053655531122949'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/issue-tracker-setting-up.html' title='Issue Tracker: Setting Up'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_NInAQbKhxFA/TdCNPKcAW2I/AAAAAAAAACw/Sj8GWbjvhMw/s72-c/CropperCapture%5B1%5D_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-1420392694343325780</id><published>2011-05-13T17:08:00.000-05:00</published><updated>2011-05-13T17:08:13.765-05:00</updated><title type='text'>ASP.NET MVC: A Journey</title><content type='html'>&lt;span xmlns=""&gt;Hello, Gentle Readers. &lt;br /&gt;
&lt;br /&gt;
I'm going to try something new: a journey on which you're allowed to ride along- and encouraged to back-seat drive.&lt;br /&gt;
&lt;br /&gt;
As a developer, it pays to keep my skills up-to-date; this is something my current support posting makes more difficult than it might otherwise be.  So, I decided that I should add some actual web development to my repertoire, and share the journey with you.&lt;br /&gt;
&lt;br /&gt;
I'll be using ASP.NET MVC3, with its Code First abilities, to design a very light-weight, overly simplified Issue Tracking system.  This is enough of a departure from the MV3 Tutorials that exist through Microsoft's site to show that I actually understand what I'm doing, and close enough to what they've done that I can crib from their notes when necessary.&lt;br /&gt;
&lt;br /&gt;
I'll be hosting the project (as I build it) on CodePlex as MvcIssueTrackerDemo.codeplex.com.  Go there for the latest code, and feel free to post recommendations/bugs/comments both at CodePlex and here in my comments.&lt;br /&gt;
&lt;br /&gt;
Now, the best journeys begin with some idea of the destination, and the most successful have some idea of the stops along the way.  So, to do our best to ensure a successful demonstration, we'll take the time to define what we're doing.&lt;br /&gt;
&lt;br /&gt;
The Destination: A functional, if overly simplified and not-at-all secure Issue Tracker.  It should be able to accept new issues, close issues, add work logs, and provide user maintenance and some basic statistics. &lt;br /&gt;
So, first, we'll design the Entity model, then we'll go about tackling each of the Entities to get them to behave like we expect.&lt;br /&gt;
&lt;br /&gt;
The expected steps: &lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Object Model &lt;/li&gt;
&lt;li&gt;Set up the Project &lt;/li&gt;
&lt;li&gt;Define the Models in code &lt;/li&gt;
&lt;li&gt;Create both Controllers and Views for each model- one at a time &lt;/li&gt;
&lt;li&gt;Prove it works &lt;/li&gt;
&lt;li&gt;Over view of the process. &lt;/li&gt;
&lt;/ol&gt;So, in this, the first post, it only makes sense to discuss the object model.&lt;br /&gt;
&lt;br /&gt;
I see the three following "entities" and one enum: Issues, Work Notes, and Users round out our entities, and we'll add a Role enum to enable some role-based security along the way.&lt;br /&gt;
&lt;br /&gt;
Our Issue Object will include: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;IssueId &lt;/li&gt;
&lt;li&gt;Title &lt;/li&gt;
&lt;li&gt;Detailed Description (I'll just call it 'Description') &lt;/li&gt;
&lt;li&gt;CreatedBy (the User Id of the user who logged the issue) &lt;/li&gt;
&lt;li&gt;CreatedDate &lt;/li&gt;
&lt;li&gt;AssignedTo (the User Id of the user to whom the issue is assigned) &lt;/li&gt;
&lt;li&gt;LastActivity (a DateTime) &lt;/li&gt;
&lt;li&gt;ClosedBy (the User Id of the user who closed the issue) &lt;/li&gt;
&lt;li&gt;ClosedDate &lt;/li&gt;
&lt;li&gt;A virtual User for the Assigned User &lt;/li&gt;
&lt;li&gt;A virtual ICollection&amp;lt;WorkNote&amp;gt; for the work logs. &lt;/li&gt;
&lt;/ul&gt;Our WorkNote object will be very simple: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;WorkNoteId &lt;/li&gt;
&lt;li&gt;Details &lt;/li&gt;
&lt;li&gt;UserId &lt;/li&gt;
&lt;li&gt;DateTimeStamp &lt;/li&gt;
&lt;/ul&gt;Users will have: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;UserId &lt;/li&gt;
&lt;li&gt;UserName &lt;/li&gt;
&lt;li&gt;LastName &lt;/li&gt;
&lt;li&gt;FirstName &lt;/li&gt;
&lt;li&gt;Location (A vague term- I'll probably use it a Cube/Office number or something) &lt;/li&gt;
&lt;li&gt;Password (In a real application, this would be a password salt and hash) &lt;/li&gt;
&lt;li&gt;Role &lt;/li&gt;
&lt;li&gt;A virtual ICollection&amp;lt;Issue&amp;gt; for the issues assigned to the User. &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
In the next post, we'll go through setting up the project, and defining the models.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-1420392694343325780?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/1420392694343325780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/aspnet-mvc-journey.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1420392694343325780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1420392694343325780'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/aspnet-mvc-journey.html' title='ASP.NET MVC: A Journey'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-1506682543734577351</id><published>2011-05-04T22:07:00.001-05:00</published><updated>2011-05-04T22:07:52.285-05:00</updated><title type='text'>Negative Confirmation: Show Me the Code</title><content type='html'>&lt;p&gt;I’ve blogged the last couple of days about Negative Confirmation as a Sender of data. That is, I believe that the person or organization who sends a file should have some process whereby files expected to be sent are flagged when they fail to go.&lt;/p&gt;  &lt;p&gt;To that end, I’ve mocked up a little something that will do just that. First, here’s an overview&lt;/p&gt;  &lt;p&gt;1) An Interface ILogReader with a single (overloaded) method: ReadLog which accepts either a Stream or a string. This is to enable the reading of virtually any kind of data. It would probably need to be modified to read a DB, but since this was more in the nature of a Proof-of-Concept, I’m not too concerned about that.&lt;/p&gt;  &lt;p&gt;2) A Class DelimitedLogReader which Implements ILogReader- for this PoC, I’m just reading a pipe-delimited file of my own design.&lt;/p&gt;  &lt;p&gt;3) A Class LogEntry to define the structure of log entries. In real code, this should probably be a struct, now that I think about it…&lt;/p&gt;  &lt;p&gt;4) Classes for handling the Scheduling- these need some work. At the moment, I have a class for the ScheduleConfigurationSettings (pulling from app.config- I tried some custom settings, but that wasn’t working and wasn’t worth pursuing for a PoC). I have a ScheduleMarshaller- which grabs the actual schedule data from app.config. Finally, I have a ScheduleResolver- the real meat of the solution- which compares the schedule as provided by the ScheduleMarshaller to the logged files provided by the DelimitedLogReader.&lt;/p&gt;  &lt;p&gt;So this works like this: The application instantiates DelimitedLogReader and grabs the log entries from a file specified in app.config. The application then instantiates the ScheduleResolver which instantiates the ScheduleMarshaller to get whatever files were scheduled to be sent the previous day. The Resolver then compares the scheduled files to the log entries and provides a list of the expected files which did not go.&lt;/p&gt;  &lt;p&gt;Here is ILogReader in its entirety&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_NInAQbKhxFA/TcIUelXVvCI/AAAAAAAAABo/Br9YTCCzFpw/s1600-h/clip_image001%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUe_BS9vI/AAAAAAAAABs/MJGRvfhq2FU/clip_image001_thumb%5B1%5D.png?imgmax=800" width="399" height="171" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;DelimitedLogReader implements ILogReader- you could do this any number of ways, here’s mine:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_NInAQbKhxFA/TcIUfNAWJzI/AAAAAAAAABw/zEY6_9eOVII/s1600-h/clip_image002%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://lh5.ggpht.com/_NInAQbKhxFA/TcIUfrg8PHI/AAAAAAAAAB0/G50XUktmB3A/clip_image002_thumb%5B1%5D.png?imgmax=800" width="408" height="338" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The ReadLog(string path) method just returns a call to ReadLog(Stream stream) by instantiating a FileStream based on the path provided.&lt;/p&gt;  &lt;p&gt;Things get a little more interesting with the ScheduleMarshaller&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUgA4R9_I/AAAAAAAAAB4/VYLpF80p1hA/s1600-h/clip_image003%5B5%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUgQfQT7I/AAAAAAAAAB8/HDan2DkF_eg/clip_image003_thumb%5B2%5D.png?imgmax=800" width="427" height="413" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The call to “translateToDayOfWeek” takes a formatted string from the ScheduleConfiguration object and then translates that as a DateTime.DayOfWeek. “translateToDate” takes the expected day and turns it into an actual DateTime object.&lt;/p&gt;  &lt;p&gt;The Resolver then does the actual work:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUgt8rakI/AAAAAAAAACA/OuW0vU3valo/s1600-h/clip_image004%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUhVWYsSI/AAAAAAAAACE/xdERUQIdgrw/clip_image004_thumb%5B1%5D.png?imgmax=800" width="431" height="496" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;With the list of strings “fileInError” you can then handle them however you want. In my case- for my PoC only, I just did a simple console application:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUhmmTLZI/AAAAAAAAACI/jfS2QPfIVqk/s1600-h/clip_image005%5B4%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://lh4.ggpht.com/_NInAQbKhxFA/TcIUh1sOqZI/AAAAAAAAACM/zSyHSC4-jAo/clip_image005_thumb%5B1%5D.png?imgmax=800" width="438" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And there you have it- a more-or-less functioning Negative Confirmation process which will alert me as the Sender when I have failed to send a file.&lt;/p&gt;  &lt;p&gt;In a real-ish scenario, I would add a module to the end of any process that sends a mission-critical file to write to the log the name of the file and the DateTime when it was sent. My Resolver would then run once a day- late enough that anything that hadn’t gone would be in error- and alert me (probably via email) of any files that didn’t go. Better- it would not send an empty email if there were no results- it would just quietly finish and wait for tomorrow’s run.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-1506682543734577351?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/1506682543734577351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/negative-confirmation-show-me-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1506682543734577351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1506682543734577351'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/negative-confirmation-show-me-code.html' title='Negative Confirmation: Show Me the Code'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_NInAQbKhxFA/TcIUe_BS9vI/AAAAAAAAABs/MJGRvfhq2FU/s72-c/clip_image001_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-1712216927641135491</id><published>2011-05-04T08:33:00.002-05:00</published><updated>2011-05-04T08:33:49.499-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EDI'/><title type='text'>EDI Process – Positive vs Negative Confirmation: An Objection</title><content type='html'>As a follow-up to yesterday’s post, and before I get to posting some actual code, I thought I’d address what I see as the most likely objection to my combined Sender Negative/Receiver Positive confirmation scheme.  It is this: “We don’t like relying on a third party for our confirmation.”  Or, put another way, “Our clients don’t expect to have to watch the process constantly, they just want it to work.”&lt;br /&gt;
&lt;br /&gt;
Now, to my mind, these are good, solid, sales-person type answers.  Unfortunately, so is, “Absolutely we can have this new major functionality that should take about 4000 man-hours to complete ready for you and in production by Tuesday!”  So you’ll excuse me if I don’t give them too much credence.&lt;br /&gt;
&lt;br /&gt;
However, as they are objections that will be raised, they should be addressed.  And so we will, in two parts.&lt;br /&gt;
&lt;br /&gt;
The first part is this: We’re not relying on a third party for confirmation, we’re providing the confirmation that makes the most sense for us to provide- if the other guy doesn’t do his, then he’s culpable for any fall-out of a failed process.  For the Sender, this means making sure you’re aware of any file that didn’t go so you can get it out the door as soon as possible.  For the Receiver, this means making sure the Sender is aware that you only got files X, Y, and Z- so that if you should have received W as well (and how would you know, for sure?) that they can send file W right along.&lt;br /&gt;
&lt;br /&gt;
The second part is this: If a file is important enough that it being missed would be a “resume generating event” for someone, doesn’t it make sense to confirm every major step in the process has worked?  And isn’t sending the file a major step in the process?  Isn’t receipt of the file a fairly major step?&lt;br /&gt;
Ultimately, I find this objection (or variations on the theme) fairly weak.  They assume that the only person who should have skin in the game is your organization.  Partnerships don’t work that way, and when you’re working with EDI, even if one group is technically a “client,” you’re working much more as a partnership than you are as an employer/employee relationship.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-1712216927641135491?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/1712216927641135491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/edi-process-positive-vs-negative.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1712216927641135491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1712216927641135491'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/edi-process-positive-vs-negative.html' title='EDI Process – Positive vs Negative Confirmation: An Objection'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-8102965958786752062</id><published>2011-05-03T17:30:00.000-05:00</published><updated>2011-05-03T17:30:29.074-05:00</updated><title type='text'>EDI Concepts: Positive vs Negative Confirmation</title><content type='html'>In EDI (the process, not as a file format), we are concerned with the delivery of data- often in some form of file.  These files are usually automated, repeating processes which are delivered on some kind of schedule.&lt;br /&gt;
&lt;br /&gt;
One of the perennial problems in EDI is how to keep track of what has been delivered.  More importantly, most of the time, you have to keep track of what hasn’t been delivered.  The problem with this, I’m sure you will agree, is that it is much harder to look at a list of items to see what isn’t there than it is to see what is there.&lt;br /&gt;
&lt;br /&gt;
This causes a debate to arise- often between developer/EDI profession and end users- of what confirmation style one will use- positive confirmation or negative confirmation.  Positive confirmation is when I, the receiver, tell you, the sender, that I have positively received a file with name XYZ.  If I can include a record-count or byte size and a timestamp, so much the better.  Negative confirmation is when I, the receiver, tell you, the sender, that I did not get file ABC which was expected in window DEF.&lt;br /&gt;
&lt;br /&gt;
Both of these have their problems.&lt;br /&gt;
&lt;br /&gt;
Negative confirmation is very, very difficult to achieve, from the receiver standpoint.  A schedule must be established and rigorously maintained, and the entire process can be very brittle.  Further, it puts the receiver on the hook for making sure the file is received, rather than making the sender responsible to ensure the file is delivered.&lt;br /&gt;
&lt;br /&gt;
Positive confirmation, however, is often wasteful and ultimately useless.  When a process runs almost every day exactly as expected, a positive confirmation process generates vast amounts of “confirmation” data that no one will review.  However, for positive confirmation to be useful, those positive confirmation notices must be reviewed diligently every time they are received.  No one, no matter how well intentioned, can do that for very long; eventually we just begin to see what we expect to see.&lt;br /&gt;
&lt;br /&gt;
So, I suggest the following Confirmation process- Negative Sender/Positive Receiver.&lt;br /&gt;
In this process, the Sender maintains their schedule and is responsible for checking it.  When a file is not delivered- for whatever reason- the Sender is alerted and can act.  Once the file is listed as “delivered,” a confirmation should still be forthcoming from the Receiver to acknowledge actual receipt of the file.&lt;br /&gt;
This style of combined confirmation helps ensure that business critical files (such as invoices or other payment related files) are sent in a timely fashion.&lt;br /&gt;
Positive confirmation is very easy to establish, as a Receiver.  Most modern FTP server packages allow for an email to be sent in response to a file received.  Failing that, an application attached to a file watcher, or some kind of Messaging Framework or Service Bus can be used to detect a new file and send the appropriate notification.&lt;br /&gt;
&lt;br /&gt;
Even from the sender standpoint, negative confirmation is still difficult.  Telling a computer “Tell me what isn’t here” is nowhere near as easy as your users probably think it is.  However, in a follow-up post, I’ll show some quick-and-dirty code which should point to a good solution for Sender side negative confirmation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-8102965958786752062?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/8102965958786752062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2011/05/edi-concepts-positive-vs-negative.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8102965958786752062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8102965958786752062'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2011/05/edi-concepts-positive-vs-negative.html' title='EDI Concepts: Positive vs Negative Confirmation'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-5575827611914103175</id><published>2010-07-17T23:45:00.001-05:00</published><updated>2010-07-17T23:45:29.843-05:00</updated><title type='text'>Testing and Debugging</title><content type='html'>&lt;p&gt;In this, the second follow-up post to my previous posting about a small project at work, I’m discussing issues that came up in testing and debugging.&lt;/p&gt;  &lt;p&gt;First, click back on that older post (&lt;a href="http://edi-fication.blogspot.com/2010/07/hack-solution-doesn-mean-hacky-code.html"&gt;here&lt;/a&gt;).&amp;#160; That’s okay; I’ll wait.&lt;/p&gt;  &lt;p&gt;Okay, done?&amp;#160; &lt;/p&gt;  &lt;p&gt;Now, did you catch my problem?&amp;#160; I didn’t until I ran against a specific scenario.&amp;#160; What happens when there’s a blank line?&amp;#160; In the case of my code, I got caught being too clever.&amp;#160; I tried to edit out blank lines.&amp;#160; My problem is that I added a “break;” when blank line was found.&amp;#160; That made my “while” loop think it was done, and then left off anything after the blank line in that file.&lt;/p&gt;  &lt;p&gt;Oops.&lt;/p&gt;  &lt;p&gt;Then, I discovered something else.&amp;#160; A requirement I had interpreted as “sometimes there will be blank lines” was actually, “Sometimes, in an otherwise populated line, you’ll receive UNIX nulls.”&amp;#160; That’ll break a StreamReader.&amp;#160; If someone knows a way to handle those in a StreamReader, I’d appreciate an email.&amp;#160; However, I don’t know such a way, and so decided the best thing to do was just copy the bytes over.&amp;#160; Then, since I’d be working with bytes, it wouldn’t matter if it was the UNIX byte that said “null,” it’s still a byte and would get copied over.&lt;/p&gt;  &lt;p&gt;Looking for a way to do this, I turned to the ultimate in developer help: &lt;a href="http://stackoverflow.com/"&gt;StackOverflow.com&lt;/a&gt;.&amp;#160; Once there, I discovered, once again, that &lt;a href="http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream"&gt;Jon Skeet&lt;/a&gt; is &lt;a href="http://www.yoda.arachsys.com/csharp/readbinary.html"&gt;awesome&lt;/a&gt;.&amp;#160; I’m not posting his code, since I mostly just added Exception Handling, and changed names so they fit my solution better, and basically used his code.&lt;/p&gt;  &lt;p&gt;So, how did I discover these problems:&amp;#160; Testing and Debugging.&amp;#160; I know it’s a long way to have gotten to what is supposed to be the point of the post, but I wanted to show how much pain it saved me, since I would have pushed to production based on the fact I knew my code “functioned as designed.”&amp;#160; The problem is that it would have been designed wrong.&lt;/p&gt;  &lt;p&gt;Using the VS testing functionality (my client is on VS2005 btw), however, wasn’t enough.&amp;#160; You see, my test passed when I ran it.&amp;#160; However, I believe whole heartedly in having actual output that I can verify.&amp;#160; Again, my code functioned as designed.&amp;#160; It wasn’t until I opened up the test output that I found my problems with those blank lines.&lt;/p&gt;  &lt;p&gt;So, three quick things about Testing your code:&lt;/p&gt;  &lt;p&gt;1) Always Unit Test your code.&amp;#160; Once I started making changes, I did start failing my Unit Test.&amp;#160; If I’d only checked my output, I might not ever have known there were additional problems.&lt;/p&gt;  &lt;p&gt;2) Set up Unit Tests which will test your assumptions as well as the code itself.&amp;#160; I could have used only files with complete data in them to test, and I would never have found my issues at all.&lt;/p&gt;  &lt;p&gt;3) Always provide yourself actual, verifiable output, whenever possible.&amp;#160; If I hadn’t done just that, I would never have known about my problem at all.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-5575827611914103175?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/5575827611914103175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/07/testing-and-debugging.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/5575827611914103175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/5575827611914103175'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/07/testing-and-debugging.html' title='Testing and Debugging'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6535079327850230656</id><published>2010-07-17T23:17:00.001-05:00</published><updated>2010-07-17T23:17:55.218-05:00</updated><title type='text'>An Explanation</title><content type='html'>&lt;p&gt;I posted a couple of days ago about a process we’re writing as a console application.&amp;#160; Since I want this to be the highest possible quality code, I believe I should defend/explain the reasons I did things the way I did.&amp;#160; &lt;/p&gt;  &lt;p&gt;After that, there will be a couple of additional posts explaining some issues we encountered and how we corrected them.&lt;/p&gt;  &lt;p&gt;So, on with the explanation…&lt;/p&gt;  &lt;p&gt;As I see it there are two basic questions (feel free to send others, though).&amp;#160; 1: Why a console app instead of a service?&amp;#160; 2: Why chained streams?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why A Console Application?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Because this is specifically requested as a temporary solution, and we were given an outer limit of days (45) that it might be needed, it didn’t make sense to do anything more complex than a Windows Service or Console application.&amp;#160; This already feeds into a BizTalk solution, so we could have gone that route, or we could have created a WCF service that would get called somewhere, but those seemed overly complex for what is, in essence, an automated version of “CTRL+C&amp;quot; “CTRL+V.”&amp;#160; &lt;/p&gt;  &lt;p&gt;So, between a Windows Service and a Console app, they both have their advantages and disadvantages.&amp;#160; &lt;/p&gt;  &lt;p&gt;A service hooked to a FileSystemWatcher could merge the files at the moment the daily file comes in.&amp;#160; Since the process that uses the merged file runs on a schedule, that could be a good thing, since we’d know that it was always ready to go when needed.&amp;#160; On the other hand, if it fails, we would have to specifically look at the file location to verify that, and if we had to re-run the process we either have to re-drop the file or find some other way to get the service to kick off.&lt;/p&gt;  &lt;p&gt;A Console application, on the other hand, has to be scheduled through the Windows Scheduler if it’s going to run as an automated process, and that means balancing the needs of running the merge early enough to be ready for the secondary process, and late enough to be sure we’ve got the file.&amp;#160; On the other hand, if it fails, it’s easy enough to pull it up and run it manually or, even, pull up the solution in TFS and run it in debug mode (to catch what the error is).&amp;#160; And, since it’s scheduled, we can know exactly when to check to verify it ran properly.&lt;/p&gt;  &lt;p&gt;In the end, it was decided it was kind of “six of one, half a dozen of the other,” and my &lt;a href="http://threevirtues.com/"&gt;Programmer’s Virtue&lt;/a&gt; of Laziness said that since I was going to have to write a console app during the debug phase anyway, I may as well just keep it as a console app.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Why Chained Streams?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Really, was there another choice?&amp;#160; I could have converted the streams to byte arrays, but that seemed overly complex for what we were trying to accomplish (turns out that was wrong, but I didn’t know that at the time).&amp;#160; We’re trying to do the equivalent of opening one file, hitting “CTRL+A” then “CTRL+C”, opening a second file, hitting “CTRL+END” then “CTRL+V”, and then saving the merged file to a folder for an automated FTP process to pick up.&lt;/p&gt;  &lt;p&gt;Reading the files and writing directly to a new, merged file, seemed to fit that need quite nicely (and would have, too, except for something I found out later).&lt;/p&gt;  &lt;p&gt;So, there you go, there was our reasoning.&amp;#160; Fairly simple and straight forward.&amp;#160; If you have other questions, please post them in the comments.&amp;#160; Maybe I’ll do another follow-up based on those.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6535079327850230656?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6535079327850230656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/07/explanation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6535079327850230656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6535079327850230656'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/07/explanation.html' title='An Explanation'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6223498872597082414</id><published>2010-07-14T23:12:00.001-05:00</published><updated>2010-07-14T23:12:55.176-05:00</updated><title type='text'>A Hack solution Doesn't Mean Hacky Code</title><content type='html'>&lt;p&gt;Today at work we ran into a little situation with a currently running process. The process is fine, but one of the parts of the business feeding data to our BizTalk orchestration needed a change. For whatever reason, the requirements for a file that gets sent through BizTalk had changed such that the file would be much, much bigger. The business unit responsible for that file said they couldn't supply the whole thing new every night (the current required process) because it would kill their other processes. What they proposed was to send one static file (old data that has to be sent every time) and then they would send the rest of the data (which changes) in the current daily process. &lt;/p&gt;  &lt;p&gt;This left us with a bit of a quandary. Since the current Orchestration looks for two files (the one from this unit, and one from another) adding a new file would cause us to have to re-write the Orchestration (which would mean un-deploying it, then re-deploying it). This was a non-starter because this requirement should only be in place for a month or so, and then we'd have to go back to the old process. &lt;/p&gt;  &lt;p&gt;So, the decision was made that we would take the static file, append the daily file to it each night, and then send it through the current process (now a single file) as normal. &lt;/p&gt;  &lt;p&gt;I was tasked with creating the code that would do that. After a brief discussion with my team mates, it was decided we'd use a Console Application which would be called by the Windows Scheduler. We considered a Windows Service, but opted for the Console App because we can see the possible need to run it manually.&lt;/p&gt;  &lt;p&gt; So, even though this is a hack process for a hack requirement, I decided that my code should be the highest possible standard- partially for personal and professional pride, and partially because no &amp;quot;temporary&amp;quot; requirement ever really goes away. So, with error checking removed (since that's a custom thing for my client), here are the basic guts. I, personally, think it's good, but please feel free to fire away with any problems you see... &lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; FileMerge&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; StaticFilePath { get; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; DailyFilePath { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; MergedFilePath { get; &lt;span class="kwrd"&gt;private&lt;/span&gt; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FinalFilePath { get; &lt;span class="kwrd"&gt;private&lt;/span&gt; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; FileMerge() { }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; FileMerge(&lt;span class="kwrd"&gt;string&lt;/span&gt; statFile, &lt;span class="kwrd"&gt;string&lt;/span&gt; dailyFile, &lt;span class="kwrd"&gt;string&lt;/span&gt; mergedFile, &lt;span class="kwrd"&gt;string&lt;/span&gt; finalFile)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            StaticFilePath = statFile;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;            DailyFilePath = dailyFile;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            MergedFilePath = mergedFile;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            FinalFilePath = finalFile;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MergeAndDrop()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            FileInfo mergedFile = Merge();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (mergedFile != &lt;span class="kwrd"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; mergedFile.Exists) Drop(mergedFile);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; FileInfo Merge()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;            &lt;span class="kwrd"&gt;using&lt;/span&gt; (StreamWriter sw = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamWriter(MergedFilePath))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;                &lt;span class="kwrd"&gt;if&lt;/span&gt; (File.Exists(MergedFilePath)) File.Delete(MergedFilePath);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;                &lt;span class="kwrd"&gt;using&lt;/span&gt;(StreamReader staticReader = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamReader(StaticFilePath))&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;                {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;while&lt;/span&gt; (staticReader.Peek() != -1)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;                    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;string&lt;/span&gt; line = staticReader.ReadLine();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(line.Trim())) sw.WriteLine(line);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;                    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;                }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;                &lt;span class="kwrd"&gt;using&lt;/span&gt; (StreamReader dailyReader = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamReader(DailyFilePath))&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;                {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;                    &lt;span class="kwrd"&gt;while&lt;/span&gt; (dailyReader.Peek() != -1)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;                    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;string&lt;/span&gt; line = dailyReader.ReadLine();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;                        &lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(line.Trim())) sw.WriteLine(line);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt;                    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;                }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; FileInfo(MergedFilePath);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Drop(FileInfo fileToDrop)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;            fileToDrop.MoveTo(FinalFilePath);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6223498872597082414?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6223498872597082414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/07/hack-solution-doesn-mean-hacky-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6223498872597082414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6223498872597082414'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/07/hack-solution-doesn-mean-hacky-code.html' title='A Hack solution Doesn&amp;#39;t Mean Hacky Code'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-947150540834630281</id><published>2010-07-09T23:30:00.001-05:00</published><updated>2010-07-09T23:30:44.878-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coding 201'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Public Code Review'/><title type='text'>File Scrubbing – whether you want to, or not</title><content type='html'>&lt;p&gt;As an EDI guy, I’m supposed to get to work in industry standard formats.&amp;#160; Since I mostly have done healthcare in the past, this primarily means the ANSI X12 4010A1 standard.&amp;#160; However, in the real world, the standard doesn’t mean much.&lt;/p&gt;  &lt;p&gt;There are clients with proprietary formats, vendors with old versions of the standard, and just plain screw-ups that we deal with on a day-to-day basis. &lt;/p&gt;  &lt;p&gt;So, with that in mind, I bring you the first in a new occasional series of posts: Public Code Review.&amp;#160; The following code is a scrubber I created to handle known, recurring issues with client and vendor files.&amp;#160; It uses Regular Expressions to find said known issues, and can either just remove them, or replace them.&lt;/p&gt;  &lt;p&gt;First, I created two Interfaces: IScubber, and IConfigurable.&amp;#160; IScrubber is the interface which will do most of the work; IConfigurable just allows anyone else who wants to use this code to use their own configuration to set it up.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;interface&lt;/span&gt; IScrubber&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;string&lt;/span&gt; Scrub(&lt;span class="kwrd"&gt;string&lt;/span&gt; original, &lt;span class="kwrd"&gt;string&lt;/span&gt; match);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;string&lt;/span&gt; Replace(&lt;span class="kwrd"&gt;string&lt;/span&gt; original, &lt;span class="kwrd"&gt;string&lt;/span&gt; match, &lt;span class="kwrd"&gt;string&lt;/span&gt; replacement);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;interface&lt;/span&gt; IConfigurable&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;void&lt;/span&gt; Configure();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Next, comes the class ScrubRule.&amp;#160; This simply holds two strings: the Regex to match the errors, and the replacement string.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;class&lt;/span&gt; ScrubRule&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Match { get; &lt;span class="kwrd"&gt;private&lt;/span&gt; set; }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Replacement { get; &lt;span class="kwrd"&gt;private&lt;/span&gt; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; ScrubRule(&lt;span class="kwrd"&gt;string&lt;/span&gt; m, &lt;span class="kwrd"&gt;string&lt;/span&gt; r)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            Match = m;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            Replacement = r;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;With our base items created, I can now create the actual scrubber.&amp;#160; In this case, I’ve called it “BasicScrubber.”&amp;#160; It implements both IScrubber and IConfigurable. &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; BasicScrubber : IConfigurable, IScrubber&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; List&amp;lt;ScrubRule&amp;gt; rules;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; BasicScrubber(&lt;span class="kwrd"&gt;string&lt;/span&gt; configPath)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            rules = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;ScrubRule&amp;gt;();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            Configure();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Configure()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;            &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt; s &lt;span class="kwrd"&gt;in&lt;/span&gt; ConfigurationManager.AppSettings.AllKeys)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;                ScrubRule sr = &lt;span class="kwrd"&gt;new&lt;/span&gt; ScrubRule(s, ConfigurationManager.AppSettings[s].ToString());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;                rules.Add(sr);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Scrub(&lt;span class="kwrd"&gt;string&lt;/span&gt; original, &lt;span class="kwrd"&gt;string&lt;/span&gt; match)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;            Regex rx = &lt;span class="kwrd"&gt;new&lt;/span&gt; Regex(match);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; rx.Replace(original, &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Replace(&lt;span class="kwrd"&gt;string&lt;/span&gt; original, &lt;span class="kwrd"&gt;string&lt;/span&gt; match, &lt;span class="kwrd"&gt;string&lt;/span&gt; replacement)&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;            Regex rx = &lt;span class="kwrd"&gt;new&lt;/span&gt; Regex(match);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; rx.Replace(original, replacement);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;As you can see, the scrubber gets it’s configuration (in this case) from the System.Configuration.ConfigurationManager class pulling from app.config:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&amp;lt;?xml version=&lt;span class="str"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding=&lt;span class="str"&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt; ?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key =&lt;span class="str"&gt;&amp;quot;RegexHere&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;=&lt;span class="str"&gt;&amp;quot;ReplacementValueHere&amp;quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;/appSettings&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;So that if we replace “RegexHere” with the Regex: &lt;code&gt;(?&amp;lt;=\.\d*)0+(?=\D|$)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;and if we replace “ReplacementValueHere” with “”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;we get a scrubber rule which will trim trailing zeros after a decimal place.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Wire this class up to a windows or console app, point it at your file in error, and let it go.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;One of the great things about Regex is its speed at just this kind of process.&amp;#160; Before I started using Regex, I tried using basic string manipulation with string.Replace().&amp;#160; The problem is that when you start playing with special characters, or if something is off just a little bit, string.Replace() is a little unreliable for my tastes.&amp;#160; Additionally, it’s slow.&amp;#160; Running string comparisons and manipulations against a normal X12 835 file used to take a couple of minutes.&amp;#160; With Regex, it’s seconds.&amp;#160; As in, two or three, not thirty or forty.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;So, let me know what you think.&amp;#160; This code should be highly portable.&amp;#160; Without much effort, it can be database driven instead of app.config driven, or you can even configure in some custom way.&lt;/code&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-947150540834630281?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/947150540834630281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/07/file-scrubbing-whether-you-want-to-or.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/947150540834630281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/947150540834630281'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/07/file-scrubbing-whether-you-want-to-or.html' title='File Scrubbing – whether you want to, or not'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-8314011530170106672</id><published>2010-07-08T20:19:00.002-05:00</published><updated>2010-07-08T20:27:01.700-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='consulting'/><title type='text'>How to Cure Insomnia</title><content type='html'>Read technical documents for 8 hours straight.

I've been at the client site for almost a full week now (technically, I guess it's a week's worth of days, but Friday before a three day weekend does not count), and I've been waiting for my system access to come through.  Because of that three day weekend thing, it's been a little slower than it would otherwise have been so I haven't had much to do.

What I have had to do is read technical specifications.  And project plan documents.  And more technical specifications.

I'm sure it will get much better tomorrow or Monday (I should have all the access I need by then) but for this week, it's been like fighting narcolepsy...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-8314011530170106672?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/8314011530170106672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/07/how-to-cure-insomnia.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8314011530170106672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8314011530170106672'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/07/how-to-cure-insomnia.html' title='How to Cure Insomnia'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-993651510633935280</id><published>2010-07-03T09:30:00.002-05:00</published><updated>2010-07-03T09:35:56.067-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='career'/><title type='text'>Changes</title><content type='html'>This week I left my position at ESI for a new position with Sogeti USA's Irving office.  I am now a consultant with Sogeti- my first gig will be providing BizTalk support while the current lead on that project goes on vacation for a month.  It should be a good way for me to get some more in depth knowledge of BizTalk with people who know more than I do about its practical capabilities.  I'm looking forward to the new adventure.

I leave the folks at ESI without regrets, but certainly with fond memories.  ESI was my first "real" development position, and I will always be thankful for the opportunity I was given there.  The whole team were "good people."  And, if you're from Texas, you know there is little better praise than that simple phrase.

So, as I begin the next phase of my journey, I say "thank you," to Jeff, Milton, Kim, and the gang at ESI.  Thanks for the opportunity.  Thanks for letting me learn.  Thanks for the memories.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-993651510633935280?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/993651510633935280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/07/changes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/993651510633935280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/993651510633935280'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/07/changes.html' title='Changes'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-3458884456676611785</id><published>2010-06-15T23:45:00.003-05:00</published><updated>2010-06-15T23:58:02.664-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Expectation Management'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>When to say "No."</title><content type='html'>Okay, let's be honest.  Sometimes, as developers, we have to say "no."  Sometimes the case for this is clear.  Something like the following:

&lt;strong&gt;Business Process Owner:&lt;/strong&gt; We need an application that will do your thinking for you!  We can call it the AwesomeApp!!

&lt;strong&gt;Developer:&lt;/strong&gt; No.

Other times, it's less clear.  Say, when you're developing a new business application, and one of the stakeholders wants to change something fairly trivial because it would be easier for them "right now."

For instance, take a situation at my job.  

We have a database to store records relating to medical insurance eligiblity requests.  One table holds the actual subscriber (insured) information.  Each subscriber gets two records: one for the request, and one for the response.  The way the process is designed, there is some information that goes out on the request which is stored with the request.  Some of that information can come back differently on the response- this information is housed in the response record.  Some of that data cannot (according to industry standards) be changed, so we decided not to store it on the response record.  Since the data structures are sufficiently convoluted to require multiple joins to get any useful data anyway, we decided one additional join wouldn't hurt anybody.  Also that storing redundant data is kind of silly.

One of the BPEs wants that duplicate data in the response record so that a "basic 'What happened to account so-and-so" query won't require joins.  Normally, I'd say "Okay" and make the change.  In this instance though (again, due to the convoluted nature of the data we send and receive) a received record without it's sent counterpart (and, for that matter, related records in other tables) has absolutely no context and would be worthless even for those "basic" querries.  So, I said "no."  I will continue to say "no" until over-ruled.

What about you, readers?  Am I way off base?  What are your "Just Say No" stories?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-3458884456676611785?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/3458884456676611785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/06/when-to-say-no.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3458884456676611785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3458884456676611785'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/06/when-to-say-no.html' title='When to say &quot;No.&quot;'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-311252107331909952</id><published>2010-04-28T15:35:00.003-05:00</published><updated>2010-04-28T15:45:06.974-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coding 201'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Lambda Expressions - The Shuttle _Tidirium_ of .NET</title><content type='html'>Actually, I just said that 'cause I wanted to get my Star Wars geek on.

Today I ran across &lt;a href="http://blogs.msdn.com/simonince/archive/2010/04/16/what-on-earth-is-a-lambda-expression.aspx"&gt;this article &lt;/a&gt;while trying to wrap my head around lambda expressions. I was trying to wrap my head around lambda expressions because they're cool (that is, useful and geeky).

So, to sum up the artical (without using his example) let's look at some code I just modified to use Lambdas.

Old Code:
&lt;blockquote&gt;&lt;p&gt;User u = (from u1 in Users
where u1.UserName == userName
select u1).First();

CurrentTicket.Reasign(u);
&lt;/p&gt;&lt;/blockquote&gt;

New Code:
&lt;blockquote&gt;&lt;p&gt;CurrentTicket.Reassign(Users.ToList().
Where(u =&gt; u.UserName == userName).First());&lt;/p&gt;&lt;/blockquote&gt;

As the article points out, these are really saying the same thing.  The Lambda Expression is just more concise.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-311252107331909952?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/311252107331909952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/04/lambda-expressions-shuttle-tidirium-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/311252107331909952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/311252107331909952'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/04/lambda-expressions-shuttle-tidirium-of.html' title='Lambda Expressions - The Shuttle _Tidirium_ of .NET'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-273349266745747880</id><published>2010-04-22T23:51:00.003-05:00</published><updated>2010-04-23T00:03:16.448-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='HIPAA'/><category scheme='http://www.blogger.com/atom/ns#' term='X12'/><title type='text'>Remittance Headaches</title><content type='html'>For those of you who've worked with X12 835 Remittance documents, you may know my pain.

Some time ago at work, I was tasked with finding a more efficient way to handle remittance advice documents for our clients.  Since I like BizTalk, I figured this would be a good time to prove its abilities, and I got to work.

In short order, I was able to write the remits to a set of tables.  With one, teensy problem.  BizTalk is (necessarily) unaware of Database relationships.  Using the WCF LOB Adapters for BizTalk worked for blowing the information into the DB very quickly, but I couldn't find a way to maintain referential integrity among the tables.  Eventually I decided on an "organic key" made up progressively larger strings as one walks down the tables.  So, for instance, a Claim Group (LX, TS3, and TS2 segments) would refer back the check on which they're found by using a string made up of the ST02 segment and the Check number.  A Claim Payment record would refer back to the claim group by adding onto it the LX identifier and so forth.  This works very well, actually, and if I know exactly the check number I want, I can find it very quickly.

However, this doesn't actually take care of all of our problems.  Those pesky end users want -&lt;em&gt;gasp&lt;/em&gt; - to be able to search for remits by Patient! or Provider!  What are they thinking?!?!

So, I have to fix my database.  But how?  I mean, I still haven't found a way for BizTalk to keep that referential integrity for me, and having BizTalk pass the 835 to a .NET application kind of defeats the purpose, so what to do?

Barring some divine (or reader) intervention, I've settled on this:  I'm writing a .NET application which will bundle up remits at the batch level (that is, i have batch object which contains my batch data as well as a list of check objects, which, in turn, hold my check data and a list of claim group objects, and so forth).  Once that is done, I'll write the records into a new database (probably nightly?) in a fashion which can be aware of record identities and referential integrity.

Please, if anyone has a better option, email me or leave it in the comments- it would be a God-send.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-273349266745747880?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/273349266745747880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/04/remittance-headaches.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/273349266745747880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/273349266745747880'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/04/remittance-headaches.html' title='Remittance Headaches'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6949673308943325136</id><published>2010-04-20T09:54:00.004-05:00</published><updated>2010-04-20T10:07:07.421-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='WSDL'/><category scheme='http://www.blogger.com/atom/ns#' term='Schemas'/><title type='text'>XML: Nillable="True" vs MinOccurs="0"</title><content type='html'>This came up at work today, as a coworker was strugling with a WSDL for an outside vendor. I only knew it because BizTalk runs into exactly this kind of error occassionally.

The situation is this: A WSDL is defined with several elements. Let's use this for an example: &lt;a href="http://4.bp.blogspot.com/_NInAQbKhxFA/S83BUkNyktI/AAAAAAAAAAU/D4K0CXPi1Z8/s1600/wsdl_wrong.PNG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 568px; FLOAT: left; HEIGHT: 260px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5462234482133340882" border="0" alt="" src="http://4.bp.blogspot.com/_NInAQbKhxFA/S83BUkNyktI/AAAAAAAAAAU/D4K0CXPi1Z8/s320/wsdl_wrong.PNG" /&gt;&lt;/a&gt; &lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;What you see here is a bunch of elements in an which my coworker is trying to show as null by not including. That is, when, for instance, "address" is null, it simply will not exist in the XML document.

Here's how the same code looks as our vendor expects it.

&lt;a href="http://4.bp.blogspot.com/_NInAQbKhxFA/S83BnJrokDI/AAAAAAAAAAc/ATdz02O-ioU/s1600/wsdl_vendor.PNG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 600px; FLOAT: left; HEIGHT: 391px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5462234801428271154" border="0" alt="" src="http://4.bp.blogspot.com/_NInAQbKhxFA/S83BnJrokDI/AAAAAAAAAAc/ATdz02O-ioU/s320/wsdl_vendor.PNG" /&gt;&lt;/a&gt;

&lt;/p&gt;&lt;p&gt;

 &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Now, leaving aside the question of why the only way to pass data to the web method is allowed to be null, we can see that the vendor's wsdl expects the nodes to exist. Therefore, instead of simply leaving out "address" the XML document should contain a node like this:

&lt;&gt;

It makes sense when you think about it in terms of code as well. How many times in C# do we pass something like "foo = new foo(new bar(), null)?" Is there any question that this is different from "foo = new foo(new bar())"? Not really. (At least, not until C# 2zillion when Microsoft decides that any parameter which can accept a NULL is automatically an optional parameter.)

I did manage to help steer the coworker in the right direction, and provided him (as I am you) a pretty good synopsis on this whole thing from IBM's website. Link here. (http://www.ibm.com/developerworks/xml/library/ws-tip-null.html)

So, in summary, pay attention to your WSDL and Schemas. Nillable is not the same as MinOccurs="0". &lt;/p&gt;&lt;address&gt;&lt;/address&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6949673308943325136?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6949673308943325136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/04/xml-nillabletrue-vs-minoccurs0.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6949673308943325136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6949673308943325136'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/04/xml-nillabletrue-vs-minoccurs0.html' title='XML: Nillable=&quot;True&quot; vs MinOccurs=&quot;0&quot;'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_NInAQbKhxFA/S83BUkNyktI/AAAAAAAAAAU/D4K0CXPi1Z8/s72-c/wsdl_wrong.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-55956197243418969</id><published>2010-04-07T22:41:00.002-05:00</published><updated>2010-04-07T22:47:30.385-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='UI'/><title type='text'>MS .Toolbox</title><content type='html'>I've been working my way (slowly) through Microsofts new &lt;a href="http://www.microsoft.com/design/toolbox/"&gt;http://www.microsoft.com/design/toolbox/&lt;/a&gt; site.  For anyone who wants to know more about UI design (which should be every Mid-tier and back-end developer everywhere), it's a really good resource.

But it brings me to something I see to much in the developer world:  the idea that if the "functionality" works, UI doesn't matter.  "Just give 'em a button" seems to be the mantra all too often.

My take on it, however, is this: If the User can't make it do what it's supposed to, or if the user decides the old way was easier than your new way, your program doesn't work.  The UI is how the users interact with your functionality; if it's not good, then it's bad.  There is no middle ground.

With WPF and Silverlight, this consideration has become much easier to handle.  Simply implement INotifyPropertyChanged on your Business Layer objects, and then use MVVM to set up the UI.  However, for people not using WPF or Silverlight, some consideration has to be made at design time for how the UI will look.  If you'll be populating a ListBox control, you probably need a collection of some kind, for instance.

This is a place where I've fallen down in the past, and I plan not to do so any more.  You should make a similar pledge.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-55956197243418969?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/55956197243418969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/04/ms-toolbox.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/55956197243418969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/55956197243418969'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/04/ms-toolbox.html' title='MS .Toolbox'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-6349339233526594000</id><published>2010-04-06T08:44:00.003-05:00</published><updated>2010-04-06T09:00:51.722-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='update'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Streams'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF WTF: Update</title><content type='html'>I attempted the solution I discovered yesterday when I got into work this morning, and it wasn't working either.  I did a little more research and discovered that, for WCF to work with Streams, you really need to pass them via a BasicHttpBinding.  As I'm not that great at WCF yet, I've been using the default WSHttpBinding that Visual Studio creates when you add a Service Reference.

I didn't really want to spend too much more time working on this- we were already getting to the point of "diminishing returns."  So I decided to take stock of where I was and move forward.  The OperationContract was defined as a Stream output with a Stream input.  However, since I know that a Stream is really just an Array of Bytes, I decided on an alternative approach.

I created a new OperationContract (called DecryptBytes) which accepts (and returns) an array of bytes.

Then, in my .svc.cs file, I created the new method which really just changes the bytes into a MemoryStream, and then hands the memory stream to my original method:

&lt;span style="color:#3366ff;"&gt;public &lt;/span&gt;&lt;span style="color:#3366ff;"&gt;byte&lt;/span&gt;&lt;span style="color:#000000;"&gt;[] DecryptBytes&lt;span style="color:#3366ff;"&gt;(byte&lt;/span&gt;&lt;span style="color:#000000;"&gt;[]&lt;/span&gt; inStream)&lt;/span&gt;
{
    &lt;span style="color:#33ccff;"&gt;MemoryStream &lt;/span&gt;&lt;span style="color:#000000;"&gt;_iBytes = &lt;/span&gt;&lt;span style="color:#3366ff;"&gt;new &lt;/span&gt;&lt;span style="color:#33ccff;"&gt;MemoryStream&lt;/span&gt;&lt;span style="color:#000000;"&gt;(inStream);&lt;/span&gt;
    &lt;span style="color:#33ccff;"&gt;MemoryStream &lt;/span&gt;&lt;span style="color:#000000;"&gt;_oBytes = &lt;/span&gt;&lt;span style="color:#3366ff;"&gt;this&lt;/span&gt;&lt;span style="color:#000000;"&gt;.Decrypt((&lt;/span&gt;&lt;span style="color:#33ccff;"&gt;Stream&lt;/span&gt;&lt;span style="color:#000000;"&gt;)_iBytes) &lt;/span&gt;&lt;span style="color:#3366ff;"&gt;as &lt;/span&gt;&lt;span style="color:#33ccff;"&gt;MemoryStream&lt;/span&gt;&lt;span style="color:#000000;"&gt;;&lt;/span&gt;
    &lt;span style="color:#3366ff;"&gt;return &lt;/span&gt;&lt;span style="color:#000000;"&gt;_oBytes.ToArray();&lt;/span&gt;
}

So, for 5 lines of code (including the Attribute Tag in the Service Contract, and the Method declarations)  I was able to correct the issue.

I feel a little silly that it was that hard to figure out, but I'll chalk it up as "lesson learned" and archive it here in case I need it again...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-6349339233526594000?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/6349339233526594000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/04/wcf-wtf-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6349339233526594000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/6349339233526594000'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/04/wcf-wtf-update.html' title='WCF WTF: Update'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-3489777421333006464</id><published>2010-04-05T22:37:00.003-05:00</published><updated>2010-04-05T22:42:39.147-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PGP'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WCF WTF</title><content type='html'>So, I have a &lt;span id="SPELLING_ERROR_0" class="blsp-spelling-error"&gt;WCF&lt;/span&gt; Service I created to handle &lt;span id="SPELLING_ERROR_1" class="blsp-spelling-error"&gt;PGP&lt;/span&gt; encryption/decryption using the &lt;span id="SPELLING_ERROR_2" class="blsp-spelling-error"&gt;BouncyCastle&lt;/span&gt; .&lt;span id="SPELLING_ERROR_3" class="blsp-spelling-error"&gt;dll&lt;/span&gt;.  We wanted just the one, internal, service so that everyone who needs to be able to decrypt data can without having to ask the developers all the time.

This service receives and passes streams of data.  Unfortunately, I did not realize that this doesn't actually work real well in &lt;span id="SPELLING_ERROR_4" class="blsp-spelling-error"&gt;WCF&lt;/span&gt;.  Unless I can find a way around it, &lt;span id="SPELLING_ERROR_5" class="blsp-spelling-error"&gt;WCF&lt;/span&gt; changes my nice &lt;span id="SPELLING_ERROR_6" class="blsp-spelling-error"&gt;FileStream&lt;/span&gt; or even just a base Stream and hides it in a System.ComponentModel.Dispatcher.StreamFormatter (from memory, so that &lt;span id="SPELLING_ERROR_7" class="blsp-spelling-error"&gt;namespace&lt;/span&gt; may be a little off).  Which is not &lt;span id="SPELLING_ERROR_8" class="blsp-spelling-error"&gt;seekable&lt;/span&gt;.  My service requires a &lt;span id="SPELLING_ERROR_9" class="blsp-spelling-error"&gt;seekable&lt;/span&gt; stream.  I'm sure you see the problem.

I didn't discover this little gem until about time to go home today.  So, tomorrow I'll write a nice little wrapper around the stream that gets passed into the service so I can treat it as a normal stream.

I'll post the code here when that's done, so I'll have it someplace relatively safe.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-3489777421333006464?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/3489777421333006464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2010/04/wcf-wtf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3489777421333006464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/3489777421333006464'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2010/04/wcf-wtf.html' title='WCF WTF'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-8539515042689751798</id><published>2009-08-26T22:49:00.004-05:00</published><updated>2009-08-26T22:54:04.693-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MIA'/><category scheme='http://www.blogger.com/atom/ns#' term='update'/><title type='text'>AWOL</title><content type='html'>"So," I hear you asking, "Where have you been for three months?"

And I answer,

Nursing my wife through the last two months of pregnancy, and welcoming my second child (Emily Marie) into the world.  So I've had more important things on my mind than this blog.

I'll be getting back to the "regularly scheduled" stuff pretty soon, but I wanted to go ahead and chart out some of what I'll be posting about in the next few weeks so I don't forget.

So, here's the list:
* BizTalk 101
     * Pipelines
     * Adapters / Accelerators
     * Basic Architecture
* EDI 101
     * Internal Standards
     * External Standards
     * SOP
* New work project

So, here's hoping I'll be able to get this back up and running...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-8539515042689751798?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/8539515042689751798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/08/awol.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8539515042689751798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/8539515042689751798'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/08/awol.html' title='AWOL'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-2573381142176763232</id><published>2009-06-09T22:01:00.002-05:00</published><updated>2009-06-09T22:06:47.282-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><title type='text'>Well, Gee...</title><content type='html'>So, at work I've been trying to get a BizTalk solution together- both to alleviate some actual pain points and as a 'proof of concept' and it's been a real pain in the donkey.

It took much longer than it should have to get BizTalk installed and configured, but we finally did it, and now I'm actually coding the solution. Yipee for me. Mostly it's going ok, but I keep running into things which make me wish (again) that I had some kind of formal training. I'm sure these questions are basic, BizTalk 101 type questions, but I can't find the answers anywhere- or, at least, not illustrated well enough to teach the concept.

So, dear reader, I'm wondering if you can help me. Below is my list of "Man I wish I knew" for BizTalk:


&lt;ul&gt;&lt;li&gt;how to: evaluate the inbound filename of a file and make a decision based on that &lt;/li&gt;&lt;li&gt;how to: establsih and use a Send Port Group &lt;/li&gt;&lt;li&gt;if multiple send groups are necessary for different types of send ports (e.g. SQL Adapter vs. FILE)&lt;/li&gt;&lt;li&gt;best practice for sending results to SQL for update, and archive file to seperate folder. &lt;/li&gt;&lt;li&gt;how to: use SQL Send Adapater &lt;/li&gt;&lt;li&gt;how to: set up SQL Stored Procedure to INSERT or UPDATE DB instead of only querying&lt;/li&gt;&lt;li&gt;how to: Configure a .NET assembly/class for use with BizTalk and call it from an orchestration  &lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-2573381142176763232?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/2573381142176763232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/06/well-gee.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/2573381142176763232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/2573381142176763232'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/06/well-gee.html' title='Well, Gee...'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-2372169614720422070</id><published>2009-05-30T23:49:00.003-05:00</published><updated>2009-05-31T00:16:22.592-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Political'/><title type='text'>A Call to Excellence</title><content type='html'>DISCLAIMER: This will be one of my Political Opinion posts. If you're not interested, then don't read it. If you are, and I upset you, I'll be more than happy to trade emails.

You have been warned.
*************************************************************************************
For the last decade or more, some in our country have attempted to make America and Americans to be less than we are. One in particular speaks of "American Arrogance" and says that we "are one nation among many." I call B.S.

Among the nations, America alone has stood as the defender of all men's rights to liberty. Even when we do not act directly to secure it, we do not deny it's existence, and lend what support we are able. Twice in history have we stood up to Evil when we could easily have stayed at home.

In WWI, we had no legitimate reason to go to war. One passenger ship was mistakenly sunk by German forces. But we, who had been looking for an excuse, took it.

In WWII, the only nation we had reason to fight was Japan: we focused on them second. Instead of spending our considerable might crushing the Japanese, we sent innumerable troops to shed their blood once more on foreign soil fighting for the rights of Europe.

We have spent our blood, our sweat, and our treasure to secure freedom, liberty, and hope for as many as we can.

Domestically, we have advanced the human condition to such a point that humans are free to believe that animals are more important than we are. Health care is such that any person can get immediate, life saving care with no thought to their ability to pay. People by the millions brave dangers we can hardly imagine- literally risking death- to come here; and the vast majority of those are willing to come and settle for a less-than-second-class existence because that is better than their "middle class" existence in their home countries.

Despite all this, we are told that we are arrogant, not excellent. We are told that we are "one nation among many," not "the bright, shining City on a hill."

My fellow Americans, I call once more for American Excellence.

Our country was founded on the idea that free persons, pursuing their passions without government interference, could become the best place on Earth. Despite this, there are those who wish us to cede more and more of our freedom in the name of security. We are told that only the Great-and-Powerful Federal Government can save: our banks, the car industry, our health care, and even our own computers. This is the same Federal Government which has: bankrupted Social Security and Medicare, instituted policies which &lt;em&gt;encouraged&lt;/em&gt; and(by one interpretation) &lt;em&gt;required&lt;/em&gt; the banks to make loans to people who could not afford them, encourages sloth and indolence by rewarding them through welfare programs, and has usurped the rights of "the several States, and the people."

So I call for Excellence.  I call for "We, the People" to stand up and say, "no more."  We can take control of our own destinies, and we can succeed in anything we wish.  To do so, we must no longer assume that those who "have not" are victims.  Calling them "victims" denigrates them and makes them less than us.  They, too, are free Americans, able, by the fruits of their labor, to overcome obstacles and to succeed in life.  Do not enslave them to the state by saying they are unable to care for themselves, and do not enslave the rest of us by saying we must care for them.

To be free means to be responsible for oneself.  It means taking chances and risking failure.  Liberty means that what I work for is mine.  It means the Government does not interfere with my life any more than necessary for any reason.  Most of all, Freedom and Liberty mean that all men are truly equal in worth, and equal in opportunities.

Freedom does not mean a right against being offended.  It does not mean that I do not have to worry about my next meal.  Liberty does not mean that I will be cared for.  It does not mean that I will never be worried.  Most of all Freedom and Liberty do not mean that others must work so that I can live well.

To find your worth, go and be excellent.  Find what you do best and &lt;em&gt;be&lt;/em&gt; the best.  Don't let anyone tell you that you are unable to succeed, and, most of all, when you fall down, pick yourself up, dust yourself off, and keep trying.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-2372169614720422070?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/2372169614720422070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/05/call-to-excellence.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/2372169614720422070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/2372169614720422070'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/05/call-to-excellence.html' title='A Call to Excellence'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-4109978515391890432</id><published>2009-05-27T21:20:00.003-05:00</published><updated>2009-05-27T21:33:45.377-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EDI'/><title type='text'>X12 != EDI</title><content type='html'>I had a brief discussion with a friend about this, and I think I need expound on the subject a little.

In the world of Development, if you say "EDI" people automatically assume (in America) ANSI X12.  Some of the more enlightened also consider EDIFACT (for our European counterparts) and HL7 (healthcare).  I'm here to explain that none of these are, in fact, EDI.

Yes, you read that correctly.  ANSI X12, EDIFACT, HL7, and Joe-Bob's Custom Layout all share one thing in common: they are file specifications.  EDI goes far beyond file specification and, in the original sense of the term (first widely used by Financial institutions, IIRC), doesn't really care about format at all.

EDI is, litteraly, "Electronic Data Interchange."  EDI is much more concerned with parties and transport than it is with specific layout.  Indeed, my trading partners and I can choose any layout we wish - including making up our own - and we'll still be doing EDI.  As long as I'm sending and receiving electronic data (in the old, CS101 sense of "raw facts given to the computer") with one or more external parties, I'm doing EDI.

Now, why is this important?  I don't guess it is really.  On the other hand, I believe it will become increasingly important, with the myriad of file specifications in addition to transport specifications, for the demarcation to be clear.  AS/1, 2 &amp;amp; 3 are EDI.  ANSI X12 is not.  FTP over SSL or SSH is EDI.  EDIFACT is not.  HTTPS is EDI.  HL7 is not.

This demarcation becomes important because there is so much to know about each world.  I'm one of those who still gets FTP/SSL and FTP/SSH confused.  I certainly couldn't tell you the difference between AS1 and AS2.  On the other hand, I can explain in detail why I prefer XML or Looped files (Such as the X12 standard) over Fixed-Width or delimited (Comma, Tab, or otherwise) flat files.  I can explain why, if I must have a flat file, I prefer delimiters to fixed-width.

I do not prettend that those who &lt;em&gt;can&lt;/em&gt; explain the difference between AS1 &amp;amp; AS2 are not EDI professionals.  I recommend that you not do so either.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-4109978515391890432?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/4109978515391890432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/05/x12-edi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/4109978515391890432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/4109978515391890432'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/05/x12-edi.html' title='X12 != EDI'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-203641336482253154</id><published>2009-05-20T22:18:00.004-05:00</published><updated>2009-05-20T22:34:48.641-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='HIPAA'/><category scheme='http://www.blogger.com/atom/ns#' term='EDI'/><title type='text'>BizTalk 101 - Installment 1 - HIPAA EDI</title><content type='html'>As I mention in my bio- I'm new to this.  And one thing I've found is that it is very difficult for newbies like myself to find information that everyone else 'just knows.'  So, fairly frequently, I'll be posting some of these 100 &amp;amp; 200 level tidbits, in case some other young developer comes along and says "That's great!  But how do I get from nothing to that point!?"

So, the first installment has to do with HIPAA.

I work for a Health Revenue Cycle Management company, so we do a lot of HIPAA EDI (ANSI X12 837, 835, etc.).  For one particular client, we don't actually &lt;em&gt;do&lt;/em&gt; anything with the files we receive except forward them on, but we do need to know what's in them so we can log them properly.

Now, for any normal implementation, that would be no big deal: the filenames would follow some standard which could be used, or the ISA 05/06 &amp;amp; 07/08 information would be sufficient, or whatever.  Oh, no.  That would be too easy. 

Anyone already in the HIPAA EDI world may know that Medicare and Medicaid often use Third Party Administrators - sometimes including normal, commercial insurance companies - to handle their claims processing.  This can mean, in the right circumstances, that a file comming from, say, CIGNA, might actually be full of Medicare claims.  This prevents us from just using the ISA sender/receiver information.

Instead, we have to parse out the entire file, just so we can read the first instance of a Patient level NM109 for the Insurance member Id to determine if this is a Medicare or Medicaid file, or if this is really a commercial payer.

Luckilly, BizTalk is our friend in this.  And this is where that long lead-off gets to some BizTalk 101.

I spent the last couple of days trying to figure out how to get BizTalk 2009 to parse out those records.  I knew that my friend Tim Rayburn (&lt;a href="http://timrayburn.net/"&gt;http://timrayburn.net&lt;/a&gt;) had addressed something similar, but it took me a while to find (in his blog, no less). 

The secret, as is said in Kung-Fu Panda, is that there is no secret.  The entire process is 7 steps.

1) Open your BizTalk project (a new one, in my case)
2) Locate the HIPAA maps (harder than you'd think- look for a self extracting zip file burried in the BizTalk folder structure).
3) Add the necessary maps to your project.
4) Deploy the project.
5) Create/Configure a Receive Port &amp;amp; receive location.
6) Create/Configure a Send Port.
7) Restart the BizTalk application.

There are a whole lot of specifics that are left out here.  But this should be enough to point anyone in the right direction to get such a thing up and running.  Tim calls this "From zero to Claims Processing in 15 minutes or less."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-203641336482253154?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/203641336482253154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/05/biztalk-101-installment-1-hipaa-edi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/203641336482253154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/203641336482253154'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/05/biztalk-101-installment-1-hipaa-edi.html' title='BizTalk 101 - Installment 1 - HIPAA EDI'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-1430108902720252234</id><published>2009-05-20T22:10:00.003-05:00</published><updated>2009-05-20T22:17:56.995-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Services'/><title type='text'>Windows Services in C# (.NET Framework 3.5)</title><content type='html'>Okay... maybe I'm just completely mis-remembering, but IIRC, when authoring a Windows Service in C# 2.0, there was a nifty 'Installer' class you could just add to your project that would be nicely configured for you.  You'd have to set the service name and a few other things, but, other than that, you could just build your application and install via MSI or (as I normally did) through InstallUtil.exe.

I guess the guys in Redmond decided we were too lazy, though, because I and two of my buddies at work (both rather more experienced than I) spent most of yesterday and a fair deal of time today figuring out why we couldn't get a @#*&amp;amp;%# service to install.  We kept getting a strange error message: "No Public Installer with RunInstallerAttribute.Yes was found."

We [SEARCHENGINE]-ed the message and we kept getting posts talking about setting up the installer class, but that wasn't good enough for us.  "Who wants to know how to do that by hand" we said.  Apparently, anyone using Visual Studio 2008.  For the life of us, we couldn't find the prebuilt installer.

So, because I'll forget if I don't have it listed somewhere...  You must create your own Installer Class (which must inherit from Installer) to install a Windows Service created in VS2008.

If anyone knows of an automated way to do this, I'd appreciate the comments...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-1430108902720252234?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/1430108902720252234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/05/windows-services-in-c-net-framework-35.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1430108902720252234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/1430108902720252234'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/05/windows-services-in-c-net-framework-35.html' title='Windows Services in C# (.NET Framework 3.5)'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16719306352505132.post-503091989715385032</id><published>2009-05-07T21:07:00.002-05:00</published><updated>2009-05-07T21:14:30.358-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Introduction'/><title type='text'>Console.WriteLine("Hello World!");</title><content type='html'>Does anyone get really bored by that statement?  I never really understood how it was supposed to be an introduction into programming...

So, welcome to my blog.  Don't mind the mess, it's still under construction.  This is the first post, so I'm not going into too much depth.  I've been developing in C# for the last couple of years, but just got my first "real" gig, so I figured I'd share as I got deeper into the world of programming.  I'll probably also post questions here, occassionally, so feel free to chime in if you have answers or comments.

Besides posts about C# and BizTalk, you'll occassionally see political and/or religous posts.  I'll try to put a nice disclaimer on those so if you find yourself thinking "shut up and code!" you can just ignore those posts and go on.

So, with that, I introduce you to EDI-fication, and hope you'll learn as much as I do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/16719306352505132-503091989715385032?l=edi-fication.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://edi-fication.blogspot.com/feeds/503091989715385032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://edi-fication.blogspot.com/2009/05/consolewritelinehello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/503091989715385032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16719306352505132/posts/default/503091989715385032'/><link rel='alternate' type='text/html' href='http://edi-fication.blogspot.com/2009/05/consolewritelinehello-world.html' title='Console.WriteLine(&quot;Hello World!&quot;);'/><author><name>AllenG</name><uri>http://www.blogger.com/profile/09469524010757827389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
