Geeks With Blogs
Title Of Blog C#
Auto-hydrate your objects with ADO.NET
Recently while writing the monotonous code for pulling data out of a DataReader to hydrate some objects in an application I suddenly wondered "is this really necessary?" You've probably asked yourself the same question, and many of you have: - Used a code generator - Used a ORM such as Entity Framework - Wrote the code anyway because you like busy work In most of the cases I've dealt with when making a call to a stored procedure the column names match up with the properties of the object I am hydrating. ......

Posted On Wednesday, April 11, 2012 9:50 AM

What's that "using" keyword used for again???
I was asked this question today and was unable to give a truly correct answer which bothered me. So, using this handle tool called the "internet" I quickly found an oldie but goodie that filled me in I've seen people make use of the "using" keyword in samples I've found online in the past but never took the time to figure out why. I always presumed it was shorthand for referencing a particular objects properties & methods without having to go ......

Posted On Monday, October 3, 2011 6:41 PM

Entity Framework 4 - When you can use Parameterized Constructors in Select
Skip to the bottom if want the quick answer ;-) Just a quick note on something I ran into today... I've taken to utilizing a View Model in which objects are created on a 1 to 1 basis to hold entities supplying data to the View/UI. As such, I modified my existing linq queries such that the View Model objects are created in the select portion of the query resulting in an enumerable list I can supply to the View. Below is an example: IQueryable<sessionfoo> fooquery = ((IEnumerable<sessionfoo... ......

Posted On Thursday, September 22, 2011 3:09 PM

Generating HTML Help files based on XML documentation
Since discovering the XML commenting features built into .NET years ago I have been using it to help make my code more readable and simpler for other developers to understand exactly what the code is doing. Entering /// preceding a line of code causes Visual Studio to insert "summary" tags. It also results in additional tags being generated if you are commenting a method with parameters and a return type. I already knew that Intellisense would pick up these comments and display them when coding and ......

Posted On Friday, February 11, 2011 2:00 PM

Base Pages and Interfaces for ASP.NET Pages
For quite a while I have been using the concept of base pages when developing pages in ASP.NET applications. It is a wonderful method for exposing common functions to all of your applications pages and also overriding certain events for various purposes (i.e. dynamic themes). Recently I found out a new developer will be joining my team. This prompted me to review the applications code for readability and ease of maintenance. I began adding comments through out the code behind for all pages within ......

Posted On Monday, January 31, 2011 10:31 AM

Use of Design vs. Source View in Visual Studio
Just a quick post back to a forum post I started regarding this topic: ASP.NET Forum Post ......

Posted On Monday, January 31, 2011 10:30 AM

Using ASP.NET Membership Provider with an ACL
Up until recently one of my applications has used the membership provider within ASP.NET exclusively. However, it has been proposed that while the currently defined roles are beneficial, security needs to be more granular to restrict both access to certain pages and functionality present within a given page. Unfortunately, the role based security ASP.NET gives you out of the box falls down in this area. This is not due to a lack of foresight by Microsoft, but rather it was simply not designed for ......

Posted On Monday, January 31, 2011 10:20 AM

Unintentional run-in with C# thread concurrency
For the first time today we began conducting load testing on a ASP.NET application already in production. Obviously you would normally want to load test prior to releasing to a production environment, but that isn't the point here. We ran a test which simulated 5 users hitting the application doing the same actions simultaneously. The first few pages visited seemed fine and then things just hung for a while before the test failed. While the test was running I was viewing the performance counters ......

Posted On Monday, January 31, 2011 10:16 AM

Copyright © Jake Rutherford | Powered by: