Election Night!

posted @ Tuesday, November 04, 2008 5:00 PM | Feedback (0), Filed Under Election

I don't want to get all political or anything.  I love how passionate people get about politics, but I hate how it becomes a fight so quickly.  Regardless, I'm glued to my seat watching the results!

Get out there and vote everyone!!

This is what I'm viewing from time to time, thought I'd share it.

Zoo trip!

posted @ Sunday, November 02, 2008 11:48 AM | Feedback (0), Filed Under Family

Went to the Philadelphia Zoo yesterday.   My wife, 3 kids, and my mother went with us.  Fun had by all!  Took a couple of shots with my iPhone I thought I'd share.

mmm...Gator

Snack time?

 

 

Giraffe's are cool

Who doesn't love Giraffe's?!

 

 

Tigers are cool...

 

My mom holding up my daughter so she can see, and my oldest son. 

 

 

Now I have to get back to playin work with jQuery!

ASP.NET MVC – It’s everywhere!

posted @ Thursday, October 30, 2008 9:14 AM | Feedback (0),

I have been having a ton of fun using the ASP.NET MVC Framework, and lately, I've been seeing others getting into it as well.   Rob Conery’s MVC Storefront series is a big one, going through the entire development of a real life application.   Then I noticed today that Amr Elsehemy is doing something similar.  I should start posting more snippets of my work and things I’ve learned.

 

What I’ve learned?

Lately? Tons.  Where to start.   Well last night I tossed out a minor blurb about the Cache Manager I’m working on.   So what else do I have to offer?  How about….Script management?

I can get more detailed into this later if people care, but lets just say that with the combination of:  

  1. A base controller to handle adding the script tags to the view data. 
  2. A Command Line version of Dean Edward’s packer.
  3. And some well placed post-build commands.

I was able to easily include what scripts I needed where, without any extra bloat.

Now I’m going to try to include this random image to see if posting images from Live Writer works.

screenshot.1225371920

It has begun!

posted @ Wednesday, October 29, 2008 4:15 PM | Feedback (0), Filed Under aspnetmvc

Well I feel the need to start sharing.   Though I don't know what I'll share, mostly what I learn is from other blogs.  But who cares? No one knows who I am yet anyway, right?

So what do I have to talk about today?  My incessant need to continuously find a "better way".  There's this project of mine, that I've been working on for about 2 years now.  The problem is I keep having to put it only hold for various reasons.  (I'm sure others can relate)  The problem is, when I come back to it, and look over the code, I'm disgusted.   Over my "break" from the code, I've continued to read, and learn, and now that I've picked my project up again, I know of a "better way" or simply just want to apply some knowledge I've learned.

This project started off as a basic ASP.NET web site using SubSonic as my tool of choice for access the database.  And now?  It's an ASP.NET MVC application using the entity framework.   Speaking of which, Hat's off the the ASP.NET MVC devs!

So what hunk of code do I have today?  Well this CacheManager tool I've been messin around with.   Here's the primary static method I'm using. 

        public static T HandleCache<T>(IQueryable<T> Query, object Value, int? MinToExpire)

        {

            var keyName = string.Format("{0}_{1}", typeof(T), Value);

            if (HttpContext.Current.Cache[keyName] != null && HttpContext.Current.Cache[keyName] is T)

                return (T)HttpContext.Current.Cache[keyName];

 

            var item = Query.FirstOrDefault();

            if (item != null)

            {

                if (MinToExpire.HasValue)

                    HttpContext.Current.Cache.Add(keyName, item, null, DateTime.MaxValue, new TimeSpan(0, MinToExpire.Value, 0), CacheItemPriority.Normal, null);

                else

                    HttpContext.Current.Cache.Insert(keyName, item);

            }

            return item;

        }


See, I'm lazy... I just want to call something like:

var account = CacheManager.HandleCache<Account>(m_AccounService.GetAccount().WithID(UserID), UserID, 20);



And poof have my Account object (If it exists) and have it all cached up and ready to go. I just feel like there could be a better way.


Technorati Tags: ,,

Archives

Post Categories

Blog Stats

  • Posts: 4
  • Comments: 0
  • Trackbacks: 0
  • Articles: 0