Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Quick example of Generic Economics

The world is moving to LINQ and here I am still learning how to think in Generics.  Take this quick example of how I am learning about generic economics.  I have a Community Server Chameleon List control of hours billed per week on all jobs per employee and wanted to display total hours.

 

 

I was thinking, okay, a #temp SQL table, calculate the total, shoot it back to the control.  Or no, add a second select to the stored proc and grab the total in a datareader.NextResult().  Then Generics Thought kicked in and the more economical approach that resulted.



 

And in Chameleon the display of that total hour figure is particularly easy wherever I want to place it on the page using


<DBVT:LaborPostData Property="TotalHours" ... />


Yeah, this new Generics stuff is pretty cool!

Comments (2) | Post RSS RSS comment feed

Posted on 1/22/2008 7:58:00 PM by Dave Burke
Categories: .NET | Community Server
Tags:

Related posts

Comments (2) -

2/9/2008 6:47:32 PM Permalink

Hey Dave,
It's me again.  Smile  You really need to embrace foreach as well.  You could rewrite that as:

foreach (LaborPost item in laborAllJobsPosts)
{
    group.TotalHours += item.Hours;
}

Now, which is easier to read?  Smile

Bill Bosacker |

2/9/2008 6:55:32 PM Permalink

Yeah, the foreach is alright...

Thanks for stopping by, Billy!

daveburke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke