You are currently browsing the monthly archive for December 2010.

It has been /interesting/ working with Entity Framework (EF).  With my first couple of sites I used Linq to SQL, and I really liked it.  It’s pretty simple once you get the gist of it.  Though now Microsoft recommends the use of Entity Framework (EF) and Linq to Entities.  Well using Linq against EF is really no different then Linq to SQL so the transition was pretty simple.  Here is a good beginner walk-through I ran into.

The part I like most about EF is Code First.  I can define my classes, relationships and inheritance and EF creates the database for me.  Need to add some properties, no problem, add them and remap (or recreate) the database.

Sure there are a few short comings like no foreign key constraints on none primary keys.  This is a pretty big deal, but nothing that can’t be handled in code (at least for my small sites).  I wonder how it’s handled with database first models, I’ll have to experiment with that some day.

The other shortcoming I found is with date fields.  It seems EF automatically works with database datetime2 field types but only creates datetime field types in its database create scrips.  This perplexed me for some time until I discovered what was really going on, and the temporary fix is pretty darn simple.

Each time you create a new script by running “Generate database from model…”–the script which is created is opened in Visual Studio (eg. myModel.edmx.sql).  Before you run it or close it, do a find and replace on the file.  Yes you guessed it, find datatime and replace it with datetime2.  Simple straight forward and works like a charm, as long as you remember to do it.

Happy coding!

I’m sure its not unique to the Chicago-land area but since shortly after the dot com demise in ’99 furniture stores have had many “going out of business” sales. In the beginning  it seemed sad that all these stores where going out of business; some of them even more than once (wtf).  Now it is just a joke and obviously a scam to get sales.

See most people automatically feel they are betting a “deal” when a place is closing down, clearing stuff out, etc.  Though in all honesty it’s shit, udder, stinky crap.  Walk into 99% of these “going out of business” stores and you will find very high prices and stock of all the stuff that doesn’t really sell well (crap).  This is because all of the good stuff was put into a truck and sent to some other store to be sold.  That other store too will be closed down in short time.  I really think this is the furniture stores new business plan, open for a year and “clear out” stock and move to a new lease.

In Orland Park Illinois there was a store I respected for some time.  Many members of my family, including myself purchased furniture there.  About 4 years ago they had a going out of business sales, I was honestly sad they where going away.  Well as you probably guessed, they are still there, it was nothing more than a scam to increase sales.  Bullshit if they sold enough to keep the doors open.

Look around any Saturday, how many human signs do you see standing around promoting “going out of business” furniture stores?

%d bloggers like this: