Category: projects


My first Nuget project: Hydrating.  Also a Codeplex project : 

It can re-make an object by adding items of “property/value”

It comes in 2 flavors: .NET 2.0 ( reflection ) and .NET 4  ( expression).

Sample Usage:

Sample usage:
var Model = new HydrateGeneric<MyModel>();
Model.AddNewProperty("OneProp", "bb");
Model.AddNewProperty("newData.StartDate", DateTime.Now.AddDays(1).ToString());
Model.AddNewProperty("newData.SecondProp", "AB");
Model.AddNewProperty("newData.aOne.ThirdProp", "XXX");
var data = Model.NewObject();


It comes from a Paulo Morgado idea from . However, his initialization does not specify property name – so it’s rather error prone if you do not specify properties + values in right order. I have somewhat improved by


Model. AddNewProperty("OneProp", "bb");



Simple messaging system -database configuration

We will create the database tables and user to access the database from the application
You will find at bottom the

  1. scripts for creating database
  2. materials to read further
  3. homework for you

As an older database programmer, I have started with database configuration.

The selected database engine is Sql Server 2008 R2 Express – the free version that can be downloaded from here :
To create tables , just start Sql Server Management Studio, point to your database, right click “Tables” node and press “New Table”
I have created the following tables in the diagram:


Several comments:

  1. The smsg_User table can ( and will !) be replaced by the owner of the site with his table of users . More, this will be configurable by the owner. That’s why I choose IDUser being varchar(150) – maybe the user id will be GUID ?
  2. The messages are stored in the smsg_Message
  3. The message archive table(smsg_Message_Archive) is simply to make the search faster on smsg_Message table. We will put here the messages older than (1 month? 2 months?)
  4. The smsg_MessageThread contains the possibility for the user to reply more than one time to a message.
  5. IDMessage is bigint . We can also put guid to have unlimited number of messages -but 9,223,372,036,854,775,807 messages ( * 2 -we will see it in action) will be enough for a small site.
  6. You can download the script from here:

Also you should not rely on Windows Identity to access the database. Why ? Because , usually , on Web hosting you have only some user name and password for database – not Active Directory user.

We will create an user that can access the Database and have full rights. We will manage further the rights for everyone.

Open SQL Server Management Studio and go to Security.

Please right click on “Logins ” in “Microsoft SQL Server Management Studio”
Step 2: Please left click on “New Login… “
Step 3: Please introduce “smsg” in “Login – New”
Step 4: Please left click on “SQL Server authentication ” in “Login – New”
Step 5: Please left click on “Password ” in “Login – New”
Step 6: Please put “smsg” in “Login – New”
Step 7: Please “smsg” in “Login – New” for confirm password
Step 8: Please left click in “Login – New”
Step 9: Please left click on “Enforce password policy ” in “Login – New”
Step 10: Please left click on “Database ” in “Login – New”
Step 11: Please keyboard input in “Login – New” […]
Step 12: Add rights : Please left click on “SMsgS “
Step 13: Please left click on “User Mapping ” in “Login – New”
Step 15: Please mouse drag end on “Current view pane ” in “Login – New”
Step 16: Please left click on “Smsg” database
Step 17: smsg user will be in the dbo schema
Step 18: Please put “dbo” as schema
Step 19: Please select “db_datareader “
Step 20: Please select on “db_datawriter ” in “Login – New”
Step 21: Please select “db_owner ” in “Login – New”
Step 22: Please left click on “OK ” in “Login – New”
Now we will verify on database:
Step 23: Please left click on “Object Explorer Hierarchy ” in “Microsoft SQL Server Management Studio”
Step 24: Please left click on “Object Explorer Hierarchy ” in “Microsoft SQL Server Management Studio”
Step 25: Please left click on “smsg ” in “Microsoft SQL Server Management Studio”

We have created database tables . We also generate a script for you that can be found here:

But the security login ( user : smsg , pwd: smsg) you do have to do yourself.
You can also download the database backup from

To read:
3 Normal Form from Database Normalization,

What if we want to send messages to a further date( let’s say, after on day 1 on the next month) ? What database changes do you envision ?

MVC4 and Simple messaging system


MVC4  Developer preview with mobile support just released. And, because best way to deal with is within an application, I decide to create a simple messaging system for any site that is made with MVC.


I begin with a registered user. What he can do:

1. Create messages ( subject + body ) to send to another registered user. The list of the users on the system will be taken either from database, either from an Application variable. The message will be recorded to a database( configured by the owner of the site )  with the possibility to be send also by email

2. When login, the registered user can see the list of messages and replies send to/by him. Also, if he has unread messages he can see an advertisement.

3. The application could be seen also from a mobile device.

What should be done also:

4. The install of the application should be easy for any developer ( xcopy or some package – like Nuget or recipe)

Wish me luck to finish !

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.