<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Programmer with Microsoft tools &#187; MVC Messaging System</title>
	<atom:link href="http://msprogrammer.serviciipeweb.ro/category/mvc-messaging-system/feed/" rel="self" type="application/rss+xml" />
	<link>http://msprogrammer.serviciipeweb.ro</link>
	<description>A programmer journey through code, books and tools</description>
	<lastBuildDate>Mon, 14 May 2012 06:59:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implementations GUI details</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/10/24/implementations-details/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/10/24/implementations-details/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 04:21:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[MVC 4]]></category>
		<category><![CDATA[MVC Messaging System]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2011/10/24/implementations-details/</guid>
		<description><![CDATA[When creating a GUI you must think to give user some good feeling about what the software can do – so I started to MVC 4 website, that have mobile support integrated.
More, you must demonstrate some features right away to the user – so what’s best if not a message from system admin to the [...]]]></description>
			<content:encoded><![CDATA[<p>When creating a GUI you must think to give user some good feeling about what the software can do – so I started to MVC 4 website, that have mobile support integrated.</p>
<p>More, you must demonstrate some features right away to the user – so what’s best if not a message from system admin to the user  to &#8220;welcome&#8221; him ?</p>
<p>For this , I have to  implement a template with <a href="http://razorengine.codeplex.com/" target="_blank">RazorEngine</a> &#8211; simple to used from his code</p>
<pre>string template = "Hello @Model.Name! Welcome to Razor!";
  string result = Razor.Parse(template, new { Name = "World" });</pre>
<p>Summary of modifications for this simple operation &#8211; send and display a message  from Admin when a user registers</p>
<ol>
<li>Add connectionstrings to web.config &#8211; to connect to database + SiteUtils static class to retrieve it.</li>
<li>RegisterAdmin user in Application_Start &#8211; in order to have user Admin in the database ( generate a GUID and put into a const)</li>
<li>Add &#8220;welcome.txt&#8221; file</li>
<li>Add RazorEngine to parse message</li>
<li>Modify  Register action in order to send message after a user registers</li>
<li>Add an area &#8220;Messaging&#8221; in order to can have the messaging separated from main site( to be easier to xcopy)</li>
<li>Add an Index action( display read/unread messages) + View</li>
<li>Add an DisplayMessage action (display a message) + View</li>
</ol>
<p>All for this picture where it shows number of unread messages(1) and list :</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/d97aaa0c18dd_6A73/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/d97aaa0c18dd_6A73/image_thumb.png" border="0" alt="image" width="486" height="239" /></a></p>
<p>You will find code at <a href="http://messagemvc.codeplex.com/SourceControl/changeset/changes/81924" target="_blank">http://messagemvc.codeplex.com/SourceControl/changeset/changes/81924</a></p>
<p>Homework:</p>
<p>Think about the user actions . He will be interested in the following for existing messages:</p>
<ol>
<li>Unread messages</li>
<li>View of all messages (paginating)</li>
<li>Search messages:
<ul>
<li>Messages from a date</li>
<li>Messages from someone</li>
<li>Search</li>
</ul>
</li>
</ol>
<p>What do you think it will be done for implementing those?</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/10/24/implementations-details/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Edmx files and testing</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/10/17/creating-edmx-files-and-testing/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/10/17/creating-edmx-files-and-testing/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 04:33:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[MVC 4]]></category>
		<category><![CDATA[MVC Messaging System]]></category>
		<category><![CDATA[Simple messaging system]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2011/10/17/creating-edmx-files-and-testing/</guid>
		<description><![CDATA[The favorite ORM in .NET world for me it is edmx files. It gives you the database plain – and have generators for POCO (http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the-entity-framework.aspx) as for EF4.1 DBContext(http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx).
I will use this one – because of the new ! But the template is over simplistic&#160; -so I improved . I do not want you to [...]]]></description>
			<content:encoded><![CDATA[<p>The favorite ORM in .NET world for me it is edmx files. It gives you the database plain – and have generators for <a href="http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the-entity-framework.aspx" target="_blank">POCO</a> (<a title="http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the-entity-framework.aspx" href="http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the-entity-framework.aspx">http://blogs.msdn.com/b/adonet/archive/2010/01/25/walkthrough-poco-template-for-the-entity-framework.aspx</a>) as for EF4.1 DBContext(<a title="http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx" href="http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx">http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx</a>).</p>
<p>I will use this one – because of the new ! But the template is over simplistic&nbsp; -so I improved . I do not want you to bother you with my experience – I want to say that, after playing with Data attributes – I decide that Fluent Configuration suits all. The template is here:</p>
<p> <a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/Creating-Edmx-files-and-testing_630C/DBContext-SecondVersion.zip" target="_blank">DBContext-SecondVersion.zip</a></p>
</p>
<p>&nbsp;</p>
<p>For example, the default template </p>
<p>Also for testing I use the fact the default EF4.1&nbsp; Model1.Context.tt generates this code:</p>
<pre class="brush: csharp;">
protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
</pre>
<p>( see playing on safe side to NOT drop the existing database?!)</p>
<p>Mine Model1.Context.tt generates this:</p>
<pre class="brush: csharp;">

 protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
    		var prefix = System.Configuration.ConfigurationManager.AppSettings[&quot;prefixTable&quot;]??&quot;&quot;;
    		bool Continue=true;
            OnBeginModelCreating(modelBuilder,prefix, ref Continue);
    		if(!Continue)
    			return;

    		//construct default
    		#region smsg_Message
    		modelBuilder.Entity&lt;smsg_Message&gt;().ToTable(prefix  + &quot;smsg_Message&quot;);
    		modelBuilder.Entity&lt;smsg_Message&gt;().HasKey(item =&gt; item.IDMessage);

    		#endregion
    		#region smsg_Message_Archive
    		modelBuilder.Entity&lt;smsg_Message_Archive&gt;().ToTable(prefix  + &quot;smsg_Message_Archive&quot;);
    		modelBuilder.Entity&lt;smsg_Message_Archive&gt;().HasKey(item =&gt; item.IDMessageArchive);

    		#endregion
    		#region smsg_MessageThread
    		modelBuilder.Entity&lt;smsg_MessageThread&gt;().ToTable(prefix  + &quot;smsg_MessageThread&quot;);
    		modelBuilder.Entity&lt;smsg_MessageThread&gt;().HasKey(item =&gt; item.IDMessageThread);

    		modelBuilder.Entity&lt;smsg_MessageThread&gt;()
                    .HasRequired(item =&gt; item.IDMessage_IDMessageInitial)
                    .WithMany(u =&gt; u.IDMessage_IDMessageInitial)
                    .HasForeignKey(x =&gt; x.IDMessageInitial)
                    .WillCascadeOnDelete(false);

    		modelBuilder.Entity&lt;smsg_MessageThread&gt;()
                    .HasRequired(item =&gt; item.IDMessage_IDMessageReply)
                    .WithMany(u =&gt; u.IDMessage_IDMessageReply)
                    .HasForeignKey(x =&gt; x.IDMessageReply)
                    .WillCascadeOnDelete(false);

    		modelBuilder.Entity&lt;smsg_MessageThread&gt;()
                    .HasRequired(item =&gt; item.IDMessageArchive_IDMessageInitial)
                    .WithMany(u =&gt; u.IDMessageArchive_IDMessageInitial)
                    .HasForeignKey(x =&gt; x.IDMessageInitial)
                    .WillCascadeOnDelete(false);

    		modelBuilder.Entity&lt;smsg_MessageThread&gt;()
                    .HasRequired(item =&gt; item.IDMessageArchive_IDMessageReply)
                    .WithMany(u =&gt; u.IDMessageArchive_IDMessageReply)
                    .HasForeignKey(x =&gt; x.IDMessageReply)
                    .WillCascadeOnDelete(false);

    		#endregion

    		OnFinishModelCreating(modelBuilder, prefix);

        }
</pre>
<p>More, for giving you a smell of what the templates generates, look at this function for reading messages sent:</p>
<pre class="brush: csharp;">

 public  IEnumerable&lt;IUserMessage&lt;IUser&lt;String&gt;,string&gt;&gt; RetrieveMessageSent(DateTime dt)
        {
            using (smsg_Message_List ml = new smsg_Message_List(ConnectionMessaging))
            {
                ml.LoadFromDB.AddToCustomPredicate(smsg_Message_FindDB.fexp_FromUser(this.Key));
                ml.LoadFromDB.AddToCustomPredicate(smsg_Message_FindDB.fexp_DateInsertedBetweenEqDate(dt, dt));
                ml.LoadFromDB.LoadFindCustomPredicate();
                return ml;
            }
        }
</pre>
<p>The class <b>smsg_Message_List</b> and the <i>AddToCustomPredicate </i>, <i>LoadFindCustomPredicate</i> and the expression <i>fexp_FromUser </i>and <i>fexp_DateInsertedBetweenEqDate </i> are automatically generated by the template.<br />
I do not think that the template is perfect – it just helps me a lot!</p>
<p>For the database tests, I was thinking of NUnit – but was deprecated by <a href="http://xunit.codeplex.com/" target="_blank">xUnit</a>. It has a nice project, named SpecificationExample – and it generates data in BDD style .<br />
For example, this code:</p>
<pre class="brush: csharp;">

 public void CreateUsersAndSendMessage()
        {

            List&lt;SimpleUser&gt; users = null;

            &quot;When create two users&quot;.Context(() =&gt; users = CreateUsersAndDeleteItFirst());
            &quot;it will be friends&quot;.Assert(() =&gt; FindFriend(users).ShouldNotBeNull());

            &quot;and when send message from first user to second user&quot;.Do(() =&gt; SendMessage(users));

            &quot;we will retrieve it searching message from first user &quot;.Assert(() =&gt; RetrieveMessageSent( users[0]).ShouldEqual(1));

            &quot;we will NOT retrieve it searching message from second user&quot;.Assert(() =&gt; RetrieveMessageSent(users[1]).ShouldEqual(0));

            &quot;we will retrieve searching messages received by second user&quot;.Assert(() =&gt; RetrieveMessageReceived(users[1]).ShouldEqual(1));

            &quot;we will retrieve count of unread messages :1 &quot;.Assert(() =&gt; RetrieveMessageUnreadCount(users[1]).ShouldEqual(1));

        }
</pre>
<p>run by this command:</p>
<pre>xunit.console.clr4.x86.exe "$(TargetPath)" /html "$(TargetDir)a.html" </pre>
<p>in Build events it will generate the following HTML</p>
<hr style="color:#c00;background-color:#c00;height:3px;border:none;">
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>✔&nbsp; When create two users and when send message from first user to second user, it will be friends</p>
<h6>Output</h6>
<pre>Before : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
After : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
</pre>
<p>0.060s</p>
<p>✔&nbsp; When create two users and when send message from first user to second user, we will NOT retrieve it searching message from second user</p>
<h6>Output</h6>
<pre>Before : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
After : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
</pre>
<p>0.099s</p>
<p>✔&nbsp; When create two users and when send message from first user to second user, we will retrieve count of unread messages :1 </p>
<h6>Output</h6>
<pre>Before : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
After : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
</pre>
<p>0.032s</p>
<p>✔&nbsp; When create two users and when send message from first user to second user, we will retrieve it searching message from first user </p>
<h6>Output</h6>
<pre>Before : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
After : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
</pre>
<p>0.053s</p>
<p>✔&nbsp; When create two users and when send message from first user to second user, we will retrieve searching messages received by second user</p>
<h6>Output</h6>
<pre>Before : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
After : testXunit.clsTestUserSendMessage.CreateUsersAndSendMessage
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<hr style="color:#c00;background-color:#c00;height:3px;border:none;">
<p>Nice , isn’t it?</p>
<p>Homework :<br />
1. use the ITLIst.tt template , search for</p>
<p>//TODO: prefix</p>
<p>and make generating same prefix for the table as in the Model1.Context.tt( search prefix)<br />
( Do not forget the change the edmx file name in the .tt file!)<br />
2. Make a .t4 file to share commonalities( such as edmx name)</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/10/17/creating-edmx-files-and-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interfaces and more</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/10/10/interfaces-and-more/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/10/10/interfaces-and-more/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 05:52:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[MVC 4]]></category>
		<category><![CDATA[MVC Messaging System]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Simple messaging system]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=802</guid>
		<description><![CDATA[&#160;
Summary:
If you want common behavior, you need an interface. And from the first one is a small step to re-organizing the program.
Body:
When you make a component for other people, you must make the possibility for those to
1. customize your software with their software
2. provide a default implementation
For the messaging component, the first customization is to [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><b>Summary:</b></p>
<p>If you want common behavior, you need an interface. And from the first one is a small step to re-organizing the program.</p>
<p><b>Body:</b></p>
<p>When you make a component for other people, you must make the possibility for those to</p>
<p>1. customize your software with their software</p>
<p>2. provide a default implementation</p>
<p>For the messaging component, the first customization is to provide a way for the site using the messaging to use their users.</p>
<p>The first step is to create a custom project which can provide guidance to the users that want to implement. VS provides XML documentation –I have checked and put also “warnings as error”</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/8859eecced12_14187/clip_image002.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/8859eecced12_14187/clip_image002.jpg"  /></a></p>
<p>Next , I have create the User interface:</p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
    /// the user that can send messages
    /// TODO version 2: make pagination
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;UserPrimaryKey&quot;&gt;the type of primary key&lt;/typeparam&gt;
    public interface IUser&lt;UserPrimaryKey&gt;
    {
        /// &lt;summary&gt;
        /// the user primary key
        /// &lt;/summary&gt;
        UserPrimaryKey Key { get; set; }
        /// &lt;summary&gt;
        /// the user name to be displayed
        /// &lt;/summary&gt;
        string UserNameToDisplay { get; set; }
        /// &lt;summary&gt;
        /// other info for the user
        /// &lt;/summary&gt;
        string OtherInfo { get; set; }

        /// &lt;summary&gt;
        /// find friends
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;search&quot;&gt;find user by name&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        IEnumerable&lt;KVPNew&lt;UserPrimaryKey, string&gt;&gt; FindFriends(string search);

        /// &lt;summary&gt;
        /// find friends online
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;search&quot;&gt;&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        IEnumerable&lt;KVPNew&lt;UserPrimaryKey, string&gt;&gt; FindFriendsOnline(string search);

        /// &lt;summary&gt;
        /// sends a message
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;message&quot;&gt;&lt;/param&gt;
        void SendMessage(IUserMessage&lt;IUser&lt;UserPrimaryKey&gt;, UserPrimaryKey&gt; message);

    }
 </pre>
<p>Two methods are interesting : SendMessage and FindFriends </p>
<p>Let’s take first SendMessage. It was obviously clear that I need another interface – the message to be sent. So the next interface created:</p>
<p><pre class="brush: csharp;">
/// &lt;summary&gt;
    /// the message to be sent to the user
    /// TODO version 2: allow messaging for more than 1 user
    /// TODO version 2: message importance
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;TheUser&quot;&gt;user interface&lt;/typeparam&gt;
    ///  /// &lt;typeparam name=&quot;UserPrimaryKey&quot;&gt;user primary key&lt;/typeparam&gt;
    public interface IUserMessage&lt;TheUser, UserPrimaryKey&gt;
        where TheUser : IUser&lt;UserPrimaryKey&gt;
    {
        /// &lt;summary&gt;
        /// subject of the message
        /// &lt;/summary&gt;
        string Subject { get; set; }
        /// &lt;summary&gt;
        /// body of the message
        /// &lt;/summary&gt;
        string Body { get; set; }
        /// &lt;summary&gt;
        /// to the user
        /// &lt;/summary&gt;
        TheUser To { get; set; }
        /// &lt;summary&gt;
        /// from the user
        /// &lt;/summary&gt;
        TheUser From { get; set; }
        /// &lt;summary&gt;
        /// cc - as in email
        /// &lt;/summary&gt;
        TheUser CC { get; set; }

        /// &lt;summary&gt;
        /// date of message
        /// &lt;/summary&gt;
        DateTime DateInserted { get; set; }

        /// &lt;summary&gt;
        /// if recipient have read
        /// &lt;/summary&gt;
        bool MessageRead { get; set; }
        // &lt;summary&gt;
        // bcc - as in email
        // &lt;/summary&gt;
        //TheUser BCC { get; set; }

    }
</pre>
<p>Let’s take the other : IEnumerable&lt;KVPNew&lt;UserPrimaryKey, string&gt;&gt; FindFriends(string search);</p>
<p>It is clear that a user can send emails to friends( maybe to anybody if we make an intranet site for an enterprise) and I must somehow have the names and id’s of the friends. I could use KeyValuePair &#8211; but it is a struct and can not be compared with null . More, usually I need more data to be transferred – so I have created long ago a KVPNew class:</p>
<pre class="brush: csharp;">
 /// &lt;summary&gt;
    /// this is the correspondent class of KeyValuePair structure from .net
    /// The features:
    /// 1. it is a class-  can be compared fastly with null
    /// 2. can be used in a search and display &lt;paramref name=&quot;AdditionalData&quot;&gt;AdditionalData &lt;/paramref&gt;
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;TKEY&quot;&gt;Key - it is compared in equals and GetHashCode&lt;/typeparam&gt;
    /// &lt;typeparam name=&quot;TValue&quot;&gt;Value to be displayed&lt;/typeparam&gt;
    public class KVPNew&lt;TKEY, TValue&gt;
    {
        public KVPNew() { }
        public KVPNew(TKEY key, TValue value):this()
        {
            this.Key = key;
            this.Value = value;

        }
        public TKEY Key { get; set; }
        public TValue Value { get; set; }
        public string AdditionalData { get; set; }
        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;

            var o = obj as KVPNew&lt;TKEY, TValue&gt;;
            if (o == null)
                return false;
            return this.Key.Equals(o.Key);

        }
        public override int GetHashCode()
        {
            return this.Key.GetHashCode();
        }
    }
</pre>
<p>And, being to interfaces, I have created also an interface for admin people to find users </p>
<p>/// &lt;summary&gt;</p>
<p>/// used by application to load plugins to find users</p>
<p>/// because each application can have it&#8217;s own way to find users</p>
<pre class="brush: csharp;">
/// &lt;summary&gt;
    /// used by application to load plugins to find users
    /// because each application can have it's own way to find users
    /// used by admins to find users
    /// Improvement version 2 : pagination
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;T&quot;&gt;user &lt;/typeparam&gt;
    /// &lt;typeparam name=&quot;UserKey&quot;&gt;user key &lt;/typeparam&gt;
    public interface IUsersFind&lt;T,UserKey&gt;
        where T:IUser&lt;UserKey&gt;
    {
        /// &lt;summary&gt;
        /// used to find users online to send message
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;UserThatMakesTheSearch&quot;&gt; the user that makes the search &lt;/param&gt;
        /// &lt;param name=&quot;Search&quot;&gt;search string - could be null&lt;/param&gt;
        /// &lt;returns&gt; a list of users&lt;/returns&gt;
        IEnumerable&lt;KVPNew&lt;T, string&gt;&gt; FindUsersOnline(T UserThatMakesTheSearch, string Search);
        /// &lt;summary&gt;
        /// used to find users (online or not )to send message
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;UserThatMakesTheSearch&quot;&gt; the user that makes the search &lt;/param&gt;
        /// &lt;param name=&quot;Search&quot;&gt;search string - could be null&lt;/param&gt;
        /// &lt;returns&gt; a list of users&lt;/returns&gt;
        IEnumerable&lt;KVPNew&lt;T, string&gt;&gt; FindUsers(T UserThatMakesTheSearch, string Search);
        /// &lt;summary&gt;
        /// find a user by his key
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;key&quot;&gt;the user key&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        IUser&lt;UserKey&gt; FindUser(UserKey key);

    }

/// &lt;summary&gt;
    /// operations with the database
    /// &lt;/summary&gt;
    /// &lt;typeparam name=&quot;User&quot;&gt;&lt;/typeparam&gt;
    /// &lt;typeparam name=&quot;UserPrimaryKey&quot;&gt;&lt;/typeparam&gt;
    public interface IUserList&lt;User, UserPrimaryKey&gt;: IDisposable
        where User : IUser&lt;UserPrimaryKey&gt;
    {
        /// &lt;summary&gt;
        /// fast delete all from database - good for testing
        /// &lt;/summary&gt;
        void FastDeleteAll();

        /// &lt;summary&gt;
        /// add to internal list
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;u&quot;&gt;the user to be added &lt;/param&gt;
        void Add(User u);

        /// &lt;summary&gt;
        /// save changes for new and old members
        /// &lt;/summary&gt;
        void SaveNew();
        /// &lt;summary&gt;
        /// save changes for old members
        /// &lt;/summary&gt;
        void SaveExisting();

        /// &lt;summary&gt;
        /// for retrieving
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;i&quot;&gt;&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        User Find(int i);

    }
</pre>
<p>The final interfaces are in this picture:</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/8859eecced12_14187/clip_image004.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/8859eecced12_14187/clip_image004.jpg" /></a></p>
<p>Next time we will create the database EF4.1 files from DatabaseFirst and we will modify .tt templates to behave nicely with relationships.</p>
<p>Homework:</p>
<ul>
<li>
 Add to IUserMessage a BCC field</li>
<li>
 What if To from IUserMessage will be directed to more than one person ?How do you implement it?</li>
<li>
 Do you think that is something missed from KVPNew class?( Hint  == operator and GetHashCode)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/10/10/interfaces-and-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple messaging system -database configuration</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/10/03/simple-messaging-system-database-configuration/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/10/03/simple-messaging-system-database-configuration/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 04:48:00 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[MVC 4]]></category>
		<category><![CDATA[MVC Messaging System]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Simple messaging system]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/?p=772</guid>
		<description><![CDATA[Contents
We will create the database tables and user to access the database from the application
You will find at bottom the 

 scripts for creating database
materials to read further
 homework for you 


As an older database programmer, I have started with database configuration.
The selected database engine is Sql Server 2008 R2 Express &#8211;  the free [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Contents</strong><br />
<em>We will create the database tables and user to access the database from the application</em><br />
<em>You will find at bottom the </p>
<ol>
<li> scripts for creating database</li>
<li>materials to read further</li>
<li> homework for you </li>
</ol>
<p></em></p>
<p>As an older database programmer, I have started with database configuration.</p>
<p>The selected database engine is Sql Server 2008 R2 Express &#8211;  the free version that can be downloaded from <a href="http://www.microsoft.com/express" target="_blank">here</a> : <a title="http://www.microsoft.com/express" href="http://www.microsoft.com/express">http://www.microsoft.com/express</a><br />
To create tables , just start Sql Server Management Studio, point to your database, right click &#8220;Tables&#8221; node and press &#8220;New Table&#8221;<br />
I have created the following tables in the diagram:</p>
<p><a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/image.png" border="0" alt="image"  /></a></p>
<p>Several comments:</p>
<ol>
<li>The<em> smsg_User </em>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 ?</li>
<li>The messages are stored in the <em>smsg_Message</em></li>
<li>The message archive table(<em>smsg_Message_Archive</em>) is simply to make the search faster on <em>smsg_Message</em> table. We will put here the messages older than (1 month? 2 months?)</li>
<li>The <em>smsg_MessageThread</em> contains the possibility for the user to reply more than one time to a message.</li>
<li>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.</li>
<li>You can download the script from here:<br />
<a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/smsgV1.zip" target="_blank">http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/smsgV1.zip</a></p>
</ol>
<p>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.</p>
<p>We will create an user that can access the Database and have full rights. We will manage further the rights for everyone.</p>
<p>Open SQL Server Management Studio and go to Security.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>Please right click on &#8220;Logins &#8221; in &#8220;Microsoft SQL Server Management Studio&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image001[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0014.jpg" border="0" alt="clip_image001[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td><strong>Step 2: </strong>Please left click on &#8220;New Login&#8230; &#8220;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image002[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0024.jpg" border="0" alt="clip_image002[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td><strong>Step 3: </strong>Please introduce “smsg” in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image003[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0034.jpg" border="0" alt="clip_image003[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 4: </strong>Please left click on &#8220;SQL Server authentication &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image004[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0044.jpg" border="0" alt="clip_image004[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 5: </strong>Please left click on &#8220;Password &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image005[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0054.jpg" border="0" alt="clip_image005[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 6: </strong>Please put “smsg” in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image006[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0064.jpg" border="0" alt="clip_image006[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 7: </strong>Please “smsg” in &#8220;Login &#8211; New&#8221; for confirm password</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image007[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0074.jpg" border="0" alt="clip_image007[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 8: </strong>Please left click in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image008[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0084.jpg" border="0" alt="clip_image008[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 9: </strong>Please left click on &#8220;Enforce password policy &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image009[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0094.jpg" border="0" alt="clip_image009[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 10: </strong>Please left click on &#8220;Database &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image010[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0104.jpg" border="0" alt="clip_image010[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 11: </strong>Please keyboard input in &#8220;Login &#8211; New&#8221; [...]</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image012[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0124.jpg" border="0" alt="clip_image012[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 12: </strong>Add rights : Please left click on &#8220;SMsgS &#8220;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image013[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0134.jpg" border="0" alt="clip_image013[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 13: </strong>Please left click on &#8220;User Mapping &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image014[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0144.jpg" border="0" alt="clip_image014[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 15: </strong>Please mouse drag end on &#8220;Current view pane &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image015[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0154.jpg" border="0" alt="clip_image015[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 16: </strong>Please left click on &#8220;Smsg&#8221; database</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image016[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0164.jpg" border="0" alt="clip_image016[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 17: </strong>smsg user will be in the dbo schema</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image017[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0174.jpg" border="0" alt="clip_image017[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 18: </strong>Please put “dbo” as schema</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image018[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0184.jpg" border="0" alt="clip_image018[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 19: </strong>Please select &#8220;db_datareader &#8220;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image019[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0194.jpg" border="0" alt="clip_image019[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 20: </strong>Please select on &#8220;db_datawriter &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image020[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0204.jpg" border="0" alt="clip_image020[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 21: </strong>Please select &#8220;db_owner &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image021[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0214.jpg" border="0" alt="clip_image021[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 22: </strong>Please left click on &#8220;OK &#8221; in &#8220;Login &#8211; New&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image022[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0224.jpg" border="0" alt="clip_image022[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
Now we will verify on database:</td>
</tr>
<tr>
<td><strong>Step 23: </strong>Please left click on &#8220;Object Explorer Hierarchy &#8221; in &#8220;Microsoft SQL Server Management Studio&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image023[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0234.jpg" border="0" alt="clip_image023[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 24: </strong>Please left click on &#8220;Object Explorer Hierarchy &#8221; in &#8220;Microsoft SQL Server Management Studio&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image024[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0244.jpg" border="0" alt="clip_image024[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><strong>Step 25: </strong>Please left click on &#8220;smsg &#8221; in &#8220;Microsoft SQL Server Management Studio&#8221;</td>
</tr>
<tr>
<td><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="clip_image025[4]" src="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/clip_image0254.jpg" border="0" alt="clip_image025[4]"  /></td>
</tr>
<tr>
<td></td>
</tr>
</tbody>
</table>
<p><strong>Summary</strong><br />
<em>We have created database tables . We also generate a script for you that can be found here:<br />
<a href="http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/smsgV1.zip" target="_blank">http://msprogrammer.serviciipeweb.ro/wp-content/uploads/MVC-4_94F/smsgV1.zip</a></em><br />
But the security login ( user : smsg , pwd: smsg) you do have to do yourself.<br />
You can also download the database backup from <a href="http://messagemvc.codeplex.com/releases/view/74250" target="_blank">http://messagemvc.codeplex.com/releases/view/74250</a></p>
<p><strong>To read:</strong><br />
3 Normal Form from Database Normalization, <a href="http://en.wikipedia.org/wiki/Database_normalization" target="_blank">http://en.wikipedia.org/wiki/Database_normalization</a></p>
<p><strong>Homework:</strong><br />
What if we want to send messages to a further date( let&#8217;s say, after on day 1 on the next month) ? What database changes do you envision ? </p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/10/03/simple-messaging-system-database-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MVC4 and Simple messaging system</title>
		<link>http://msprogrammer.serviciipeweb.ro/2011/09/25/mvc4-and-simple-messaging-system/</link>
		<comments>http://msprogrammer.serviciipeweb.ro/2011/09/25/mvc4-and-simple-messaging-system/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 20:57:51 +0000</pubDate>
		<dc:creator>Andrei Ignat</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[MVC 4]]></category>
		<category><![CDATA[MVC Messaging System]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Simple messaging system]]></category>

		<guid isPermaLink="false">http://msprogrammer.serviciipeweb.ro/2011/09/25/mvc4-and-simple-messaging-system/</guid>
		<description><![CDATA[&#160;
MVC4&#160; 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.
Description:
I begin with a registered user. What he can do:
1. Create messages ( subject + body ) to send to another [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<p><a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=27419" target="_blank">MVC4&#160; Developer preview</a> 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.</p>
<p>Description:</p>
<p>I begin with a registered user. What he can do:</p>
<p>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 )&#160; with the possibility to be send also by email</p>
<p>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.</p>
<p>3. The application could be seen also from a mobile device.</p>
<p>What should be done also:</p>
<p>4. The install of the application should be easy for any developer ( xcopy or some package – like Nuget or recipe)</p>
<p>Wish me luck to finish !</p>
]]></content:encoded>
			<wfw:commentRss>http://msprogrammer.serviciipeweb.ro/2011/09/25/mvc4-and-simple-messaging-system/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

