Imagine Cup 2013 – Backstage

As many teams starting in imagine cup, there will be also huge numbers of newbe at programming, and I would like to give informations that will be helpful to them.

First, you have to manage your team and tasks, I use trello because it have pith of GTD. Just do it don’t use complicated system, it is not needed.

Second, you have to keep somewhere files of your projects (not only sources) and with help comes bitbucket, there is also github but unfortunately private repo is paid.

The least but not least, when you need sketch something or plan it use these few tools Microsoft Visio. I think it’s the best tool to create model of database, what else ? if there’s need of simple mockup of website or application I recomend you Moqups.

P.S Well, code, code and maybe we will see at St. Petersburg 😉

Entity Framework – missing feature

When I was working on this test
I saw big disadvantage, there is no method created to delete collection of items at our database, on the other hand other ORMs have this feature. I think it’s good idea to have this feature, so I created topic with my idea. If you need this feature, please vote.

Now :

After :

 

IIS mod_rewrite – WordPress fix

My blog is powered by Oktawave. I decided to keep here my personal projects and blog, when I installed my blog, I wanted to configure friendly url, for SEO purpose, but unfortunately was a problem. Basic IIS wasn’t configured.

First of all you have to download ISAPI_Rewrite 3 make sure that it’s lite version next step is is add ISAPI to IIS filter site, navigate your IIS Manager to ISAPI Filters

isapifilters

Then click add, and fill path to your executable file, named “ISAPI_Rewriter3.dll”.

Last but not least is fill your httpd.conf file, if you have lite version it’s places in C:Program FilesHeliconISAPI_Rewrite3 folder, otherwise find this at your web folders. Edit file with next context

Finally save & restart IIS Server.

ORM Series : Entity Framework Migration

Entity Framework, has given with last update, migrations at code first, undoubtedly it’s the best feature in this update. This tool is very helpful if we change something at our model, and then we can simply upgrade our database. Moreover it can fulfill role as a database versioning, because we can easily to manage our updates and freely manage between them.

Whole system is based on Package Manager Console. Basic commands

  • Enable-Migrations
  • Add-Migration {name of commit}
  • Update-Database

Enable-Migration we are using only once. It’s command which create basic files need to start work with migrations. Add-Migration is command we will use if we want to add some changes to database, and it generate file with . Update-Database – execute migrations files

First we have to create our model, I created simple music database:

 

 

 

Now we will run our Packer Manager Console with Enable-Migrations command.

If executed command was properly , we will see ‘Migrations’ folder.

image

Now we can execute next command, Add-Migration BaseOfDatabase. ‘BaseOfDatabase’ is name of commit so choose wisely because it should describe in one – two words what you have done here. Moreover there is a new generated file.

image1

That file include code that will be executed at final step, code sample one from few methods.

 

Now we can execute all of updates. By using Update-Database command. If everything goes properly, let’s change our model to show you, power of Migrations.

Album.cs

Song.cs

Let’s now commit our changes, execute Add-Migration command, result of execution

Update database, our database has given these two columns. Now we can freely downgrade or upgrade our version of database. 🙂 so if we decided after thousands of commit to delete these columns

Score : For this feature I will give EF two stars in category “Uniqueness”
summary_sec