Geeks With Blogs
Lee Brandt's Blog You're only as smart as your last line of code Learning
MVC3 RC _ViewStart Page
For those of you following the MVC releases, you will see something new in your File->New for MVC3 RC: _ViewStart.cshtml (_ViewStart.vbhtml for you VBers). This is a common place to dry out view dependencies. The most common view dependency is the MasterView it will use. To that end, the default _ViewStart page you get from a File->New MVC3 project has just the: 1: @{ 2: Layout = "~/Views/Shared/_Layout.csh... 3: } This seems to be done by convention. The view must be named “_viewstart.cshtml” ......

Posted On Saturday, November 13, 2010 2:51 PM

Using Linq to Test Your Query Logic Without Touching The Database
That’s right, I said it, I’ve been doing it, and I abso-effin-lutely love it. A few months ago my co-worker, Troy, posted a question on Stack Overflow. We were doing integration testing on a project we were working on, and as the object graph grew larger, the code required to test query logic became painful. Since I am a sissy and don’t like pain, Troy asked the question on SO about how we might do it less painfully, and we got this answer, and it totally changed our TDD/BDD lives. The answer came ......

Posted On Thursday, May 7, 2009 7:28 PM

A Fine How Do You Do (It)
I've been using 64-bit Windows & on my laptop for a couple of weeks now and I'm pretty happy with it. I was very happy with my Windows 2008 Server install, but I finally took the plunge to pave my laptop with WIndows 7. I found a little trick today that will get me around something that was annoying me since I installed. If you use the task bar buttons to launch a program (like where your quick launch menu would be), if you click it again, it does NOT open a second instance of the program, even ......

Posted On Saturday, March 7, 2009 9:29 PM

Implicit Conversion Operators
Recently, we added a SSN type to our project. I also wanted to make an implicit conversion from a string, so that when using it I could do: 1: SSN mySsn = "111-22-3333"; I came across an msdn page about how to code it and thought I'd post it here for posterity. 1: using System; 2: 3: namespace Examinetics.Core 4: { 5: public class SSN 6: { 7: private readonly string _ssn; 8: 9: public SSN(string ssnString) 10: { 11: _ssn = ssnString; 12: } 13: 14: // implicit string converter 15: public static implicit ......

Posted On Wednesday, December 24, 2008 12:43 AM

XP Can Impove Your Code... But It Won't
QUICK THOUGHT: The engineering practices in Extreme Programming (Like TDD, Pair Programming, etc) can lead you to improving your code. But it won't do it for you. TDD will point out design flaws, but it won't GIVE you good design skills. If you write lousy code, you'll find it very hard to maintain practicing XP, but XP won't MAKE your code better. You still have to do it. You STILL have to read books, write code and share with other developers.

KAIZEN!

~Lee

Posted On Monday, November 17, 2008 1:23 PM

ReSharper Keyboard Shortcut of the Day
As I try and learn about all the available productivity features of R#, I will post what I learn here... for posterity and for anyone who might find it useful. Alt+Insert is used to generate code in the text editor window. If you are in the text editor, it will bring up a context menu to allow you to generate ctors, members and properties. If you highlight a place in the Solution Explorer and hit Alt+Insert, it will bring up a context menu for generating a class, interface or struct in that folder ......

Posted On Tuesday, October 28, 2008 11:58 PM

Overriding the Default Conventions in Fluent NHibernate
Today I needed to override the default convention settings in Fluent NHibernate. By default, fNH sets up the default key columns that it looks for as “[TableName]_id”. The convention that we decided on at my work is ID for the surrogate key column of the table and “[TableName]ID” for every place it is used as a foreign key. In our RepositoryBase class is where we setup the session factory for NHibernate. This is also the place where you set up the PersistenceModel for fNH. Normally, what you might ......

Posted On Tuesday, September 2, 2008 6:46 PM

Three Ways to Register Dependencies with StructureMap 2.4.9
I've been using StructureMap for my dependency injection container for a little while now and I wanted to discover all the ways (I could find) to register my dependencies. Here's is what I came up with (If you know of more or see something wrong drop me a comment): I've got a project with a console app, a project for my dependencies (memento and concrete types), and a project that does my dependency registration (when I do it in code). My console app just gets the default concrete type first, then ......

Posted On Sunday, August 10, 2008 4:26 AM

SlickEdit 2008 is pretty... well... slick.
The good folks at SlickEdit® hooked me up with a review copy of SlickEdit 2008 Professional, and I gotta tell ya I was pretty surprised. I didn't really know what to expect. I guess I just expected a less feature-rich Visual Studio, but that's definitely not what I found. First of all, I wouldn't consider SlickEdit to be a competitor to Visual Studio. It's more of a multi-purpose polyglot programmer's editor on steroids. First, on install, it asks about your editing environment emulation. This is ......

Posted On Friday, June 13, 2008 5:23 PM

NCover with MSTest
I was trying this morning to run NCover (for the first time). I downloaded a eval copy (sweet!) and then opened NCover Explorer only to find myself a little lost. So I thought I'd RTFM a bit first. That helped (a little), and the documentation online also helped some, but what I really needed to do was check my MSTest test coverage of my base framework. The documentation really only covered generic scenarios and a little bit of googling only left me wanting. All these little bits and pieces, however, ......

Posted On Thursday, May 15, 2008 1:47 PM

There is no right answer
I know you've probably heard it before: "There is no silver bullet." Basically, this means that there is no right answer for a particular problem in every situation. There is only the best solution that you know for each individial scenario. For instance, if you have to load a dependency for an object, you could use dependency injection or a provider model; but if you have to load an object's dependencies and that dependency's dependencies (the leg bone depends on the ankle bone and the ankle bone ......

Posted On Thursday, May 8, 2008 8:44 AM

Object Oriented Design Part I
I realize that this is probably WAY beginner stuff for most people who read these blogs, but I am giving these classes to some people who come from a structured programming background and it may help others in the same boat. I like to think I know OOD pretty well, but if you see something that you think (or know) is wrong drop me a comment (no flames please). In the Beginning... There was structured programming; and the developers saw that it was good. The coded and rejoiced at the marvels they created. ......

Posted On Tuesday, April 22, 2008 4:29 PM

How do YOU arrange your ASP.NET MVC app?
As I am learning about TDD and MVC, one thing comes up. How should I arrange my models, views and controllers? Of course, I know I need to set up the models view and cotrnollers folders for ASP.NET MVC, but what view actions should go into a controller? An example may help illustrate my question: In the default project template for an ASP.NET MVC app, you get a HomeController which has to actions in it: Index and About. Should the about really be an action on the home controller? I guess my initial ......

Posted On Monday, April 14, 2008 2:57 AM

Creating SSIS Package Error
Not sure why this happens, but I was trying to create an SSIS package on my work machine (this'll be my first SSIS package since DTS died), and recieved a weird error: Failed to save package file "C:\TEMP\tmp18D.tmp" with error 0x8002802B "Element not found" Turns out that this is due to MSXML6 not being registered. I found the solution here: http://forums.microsoft.com... Basically: To register MSXML 6.0. 1. From the Start menu, click Run. 2. Enter the ......

Posted On Thursday, April 10, 2008 4:46 AM

MSIT or MBA?
This is a question I have been asking myself on and off for about a year now. I have researched all the schools, and all the programs, and I have to make a decision. I want to continue my education, but I should I go for a Master's in a technical realm or a business one? I have pretty good technical skills, and I am learning so much just from reading books and blogs and going to .NUG meetings, so I think maybe my education should be toward an MBA. I think it might help to solidify my ability to talk ......

Posted On Sunday, April 6, 2008 2:36 PM

I Wanna Be Like Mike
Actually, I wanna be like ScottGu and ScottHa and Phil Haack, and.... well you get the idea. I have been thinking about things I want to accomplish in my career for awhile now. I have set out some goals for myself. Like Becky Isserman, I want to become an MVP. This is a bit longer road for me because, I have not been super active in the developer's community here. It's not that I don't want to, I just haven't figured out how. I haven't figured out how ScottGu and ScottHa and Phil manage to do it. ......

Posted On Sunday, April 6, 2008 2:23 PM

(IN)Active Directory
I have a small page I need to write for my company to list all empoyees. This in effect becomes the in-house phone roster. Makes sense, right? I though it'd be no problem. I know I can manipulate AD from an ASP.NET page, so I'll put together this app no problems. OK, my hubris got the best of me. I queried the AD Directory service no problem: DirectoryEntry server = new DirectoryEntry(); DirectorySearcher searcher = new DirectorySearcher(); searcher.SearchRoot = server; searcher.SearchScope = SearchScope.Subtree; ......

Posted On Thursday, April 3, 2008 1:13 PM

What's with all the NEW stuff?!!??
As I get settled in at this new job, I begin to take stock of what the company wants to accomplish: a solid, extensible product with the longest possible useful life. Given the fact that this product will probably take 2-3 years (total) to develop, that means learning the newest stuff and looking at some technologies that have yet to be released. The new technologies coming out of Microsoft in the next six to twelve months is staggering. Beyond products (like Windows 2008, SQL Server 2008 and Visual ......

Posted On Thursday, April 3, 2008 1:11 PM

TDD, MVC, IOC/DI & ASP.NET (MAN! that's a lot of initials!)
I am creating a blog engine. Not because the world needs another, but because there are some techniques I want to learn about and creating this very straight-forward project will allow me to do that. First step was to create the project and start experimenting with Test-Driven Development inside MVC for ASP.NET. I started by searching for TDD MVC and ASP.NET which led me to this article by phil haack. While trying to put together some of my first tests, I had to use a mock object. The easiest way ......

Posted On Thursday, April 3, 2008 1:11 PM

XML, XPath and XML Namespaces oh my!
I was just about to /mywrists today when I found this post. I wanted to post to this blog to say thanks to SteveX for posting it. I was trying to read a web.sitemap file in as an XML doc and work with it. I was screaming at my screen that I KNEW there were nodes matching my XPath (//siteMapNode) but it always returned 0 nodes. Thanks again to SteveX for savin' my life. :0) ~L ......

Posted On Thursday, April 3, 2008 1:10 PM

Copyright © Lee Brandt | Powered by: GeeksWithBlogs.net