﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
  <channel>
    <title>Bryan Avery - Blog</title>
    <description>that and this</description>
    <link>http://www.bryanavery.co.uk/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.5.0.6</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://www.bryanavery.co.uk/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.bryanavery.co.uk/syndication.axd</blogChannel:blink>
    <dc:creator>Bryan Avery</dc:creator>
    <dc:title>Bryan Avery - Blog</dc:title>
    <geo:lat>5,380,065.000000</geo:lat>
    <geo:long>-4,064,941.000000</geo:long>
    <item>
      <title>How to move a Joomla website</title>
      <description>&lt;p&gt;So I've been volunteering for an NGO called Otra Cosa Network in Peru and as part of my volunteering I have been teaching young children to swim, but of course I get roped into helping with their website. &amp;nbsp;A busman's holiday I know..!&lt;/p&gt;
&lt;p&gt;So their existing website is using Joomla so the first step for me is to back a backup copy of the existing Joomla website.&lt;/p&gt;
&lt;p&gt;I found JoomlaPack, which is now called Keeba Backup, which can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.akeebabackup.com/download.html" target="_blank"&gt;https://www.akeebabackup.com/download.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;They recommend you follow the videos on their website&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.akeebabackup.com/videos/1212-akeeba-backup-core/1615-abtc01-installation-first-backup.html"&gt;https://www.akeebabackup.com/videos/1212-akeeba-backup-core/1615-abtc01-installation-first-backup.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now that you are able to backup the website, I needed to restore the live website to backup site, to do this you need to download Keeba KickStart and unzip the files, taking just the kickstart.php file which you'll need to add to the root folder of the new website, also copy across the backup file you wish to restore.&lt;/p&gt;
&lt;p&gt;A backup of your web site is only useful if you can restore it - perhaps you need to transfer your web host or even move the site from a development server to a live server.&lt;/p&gt;
&lt;p&gt;Like always I have attached the version I worked with at the bottom of this post.&lt;/p&gt;
&lt;p&gt;Here is a step by step process for you to restore the backup you have just taken:&lt;/p&gt;
&lt;p&gt;Or you can watch the &lt;a href="https://www.akeebabackup.com/videos/1212-akeeba-backup-core/1618-abtc04-restore-site-new-server.html" target="_blank"&gt;video here&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;To begin with, take a brand new backup of your web site.&lt;/li&gt;
&lt;li&gt;Once the backup is complete, go to Manage Backups and download the backup file to your computer.&lt;/li&gt;
&lt;li&gt;Now we've downloaded the backup file, we need an additional program called Kickstart which you can find at the akeebabackup.com web site.&lt;/li&gt;
&lt;li&gt;Go to downloads. Scroll down to Akeeba Kickstart and click Download to download the file to your computer.&lt;/li&gt;
&lt;li&gt;The Kickstart program is NOT a Joomla extension. Here we can see that the Kickstart program is a zip file and we need to extract that.&lt;/li&gt;
&lt;li&gt;On most operating systems you can do that simply by double clicking on the file name.&lt;/li&gt;
&lt;li&gt;We can see we now have a new folder with all the kickstart files in it.&lt;/li&gt;
&lt;li&gt;The only one that you actually need is the kickstart.php file; all the rest are language translations.&lt;/li&gt;
&lt;li&gt;We now need to transfer the kickstart.php and our backup to our brand new web host, and to do that we will use a FTP program.&lt;/li&gt;
&lt;li&gt;I am going to use filezilla but you can use any ftp program that you like.&lt;/li&gt;
&lt;li&gt;To begin with, connect to your NEW server.&lt;/li&gt;
&lt;li&gt;Once connected, make sure you are in the public html or the web root of your server.&lt;/li&gt;
&lt;li&gt;Now you need to transfer the backup file from our local computer to our live server. I am just going to pick that up and drag it across.&lt;/li&gt;
&lt;li&gt;You can see the upload is taking place. We now have the backup file on the new server.&lt;/li&gt;
&lt;li&gt;We now need to take that kickstart.php file and do exactly the same thing. Select it and drag it across.&lt;/li&gt;
&lt;li&gt;That's it with the filezilla for now so let's go back to our web browser and go to our brand new web site.&lt;/li&gt;
&lt;li&gt;As you can see I have a holding page in place to show that the web site is coming soon.&lt;/li&gt;
&lt;li&gt;So just go to the special url for kickstart.php. The kickstart program is now running.&lt;/li&gt;
&lt;li&gt;Kickstart is NOT an installation program, it is a special archive extraction tool.&lt;/li&gt;
&lt;li&gt;We can click here to remove this message and we can see here that it has detected the archive file.&lt;/li&gt;
&lt;li&gt;We have several methods of extracting the files. On most good web hosts, we can use the hybrid method.&lt;/li&gt;
&lt;li&gt;Finally click START to begin the extract process.&lt;/li&gt;
&lt;li&gt;Kickstart has now extracted the backup file and provides a link to the installer that was built in to that backup.&lt;/li&gt;
&lt;li&gt;The installer is a very simple process. We begin with the required settings. As you can see, they are all set to yes. If any are set to No, you won't be able to proceed and you need to speak to your web hosts to rectify the errors.&lt;/li&gt;
&lt;li&gt;We can now click Next.&lt;/li&gt;
&lt;li&gt;I know need to enter the database connection details that I have got from my web host.&lt;/li&gt;
&lt;li&gt;Enter the server hostname (which is usually localhost, but that may depend on your hosting) and your DATABASE username and password. And finally the database name that you want to install your web site on. Again this is something that your host will have provided to you or you will have set up yourself within your hosts control panel.&lt;/li&gt;
&lt;li&gt;And click next.&lt;/li&gt;
&lt;li&gt;The restoration process of the database has now been processed and we can click to continue.&lt;/li&gt;
&lt;li&gt;We have now have the opportunity if we wish to change the site name and the email address. In most cases when you are restoring a site you won't need to do this.&lt;/li&gt;
&lt;li&gt;If we scroll down there is also the opportunity to change the password and email address of the Super Administrator.&lt;/li&gt;
&lt;li&gt;Finally, click Next again.&lt;/li&gt;
&lt;li&gt;The sites configuration has all been setup.&lt;/li&gt;
&lt;li&gt;Now what we need to do is close this window and when we are now back at the Akeeba Kickstart program and click on Cleanup.&lt;/li&gt;
&lt;li&gt;This will remove the kickstart.php file and that big backup archive.&lt;/li&gt;
&lt;li&gt;Now that we're done we can visit our website and here we can see that the web site has now been transferred from our old hosting account to our new one.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bryanavery.co.uk/file.axd?file=2016%2f2%2fcom_akeeba-4.5.5-core.zip"&gt;com_akeeba-4.5.5-core.zip (2.48 mb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bryanavery.co.uk/file.axd?file=2016%2f2%2fkickstart-core-4.1.4.zip"&gt;kickstart-core-4.1.4.zip (267.22 kb)&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2016/02/27/How-to-move-a-Joomla-website.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2016/02/27/How-to-move-a-Joomla-website.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=c2440bae-9421-4474-ac5d-3c8662d527df</guid>
      <pubDate>Sat, 27 Feb 2016 20:56:00 +0000</pubDate>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=c2440bae-9421-4474-ac5d-3c8662d527df</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=c2440bae-9421-4474-ac5d-3c8662d527df</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2016/02/27/How-to-move-a-Joomla-website.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=c2440bae-9421-4474-ac5d-3c8662d527df</wfw:commentRss>
    </item>
    <item>
      <title>The way to handle unauthorised requests to Ajax actions in ASP.NET MVC</title>
      <description>&lt;h2&gt;Problem&lt;/h2&gt;
&lt;p&gt;I have created a view that posts to an action via Ajax with the expectation that the action will return the requested data or an empty string. &amp;nbsp;Even better, I would like it to be configurable to return whatever value I see fit.&lt;/p&gt;
&lt;p&gt;The problem arises when I decorate the called action with the [Authorize] attribute. &amp;nbsp;If the request is not authorized and I have a loginUrl configured in my web.config, my ajax request will return the html output of my loginUrl view. &amp;nbsp;That is undesirable.&lt;/p&gt;
&lt;h2&gt;Solution&lt;/h2&gt;
&lt;p&gt;I can extend the existing Authorize attribute by inheriting from the AuthorizeAttribute class. &amp;nbsp;Here is the code that extends the Authorize attribute:&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;public class AjaxAuthorizeOverrideAttribute : AuthorizeAttribute
    {
        public string View { get; set; }

        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            if (!filterContext.HttpContext.Request.IsAjaxRequest())
            {
                base.HandleUnauthorizedRequest(filterContext);
                return;
            }

            filterContext.Result = new ViewResult { ViewName = View };
            filterContext.Result.ExecuteResult(filterContext.Controller.ControllerContext);
        }
    }&lt;/pre&gt;
&lt;p&gt;Here is the decorator for the ajax action in the controller class:&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;[AjaxAuthorizeOverride(View="AjaxAuthorizeError")]

public ActionResult AjaxRequest()
{
     return View();
}&lt;/pre&gt;
&lt;p&gt;Note: there is no default view page being rendered.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Original article can be found &lt;a href="https://curtismitchell.wordpress.com/2010/03/22/two-ways-to-handle-unauthorized-requests-to-ajax-actions-in-asp-net-mvc-2/" target="_blank"&gt;here&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/12/18/The-way-to-handle-unauthorised-requests-to-Ajax-actions-in-ASPNET-MVC.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/12/18/The-way-to-handle-unauthorised-requests-to-Ajax-actions-in-ASPNET-MVC.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=3bb11891-9ae2-484a-aaf7-ad4eedf592fe</guid>
      <pubDate>Thu, 18 Dec 2014 10:12:00 +0000</pubDate>
      <category>MVC</category>
      <category>Security</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=3bb11891-9ae2-484a-aaf7-ad4eedf592fe</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=3bb11891-9ae2-484a-aaf7-ad4eedf592fe</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/12/18/The-way-to-handle-unauthorised-requests-to-Ajax-actions-in-ASPNET-MVC.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=3bb11891-9ae2-484a-aaf7-ad4eedf592fe</wfw:commentRss>
    </item>
    <item>
      <title>Creating and Publishing to NuGet</title>
      <description>&lt;p&gt;Now that we have a Nuget Server installed and up and running we will want to deploy our packages.&lt;/p&gt;
&lt;p&gt;First you'll need to install the nuget.exe command line bootstrapper&lt;/p&gt;
&lt;h2&gt;Installing NuGet.exe&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Download &lt;a href="http://nuget.codeplex.com/releases/view/58939" target="_blank"&gt;NuGet.exe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Place NuGet in a well known location such as c:\utils on your machine&lt;/li&gt;
&lt;li&gt;Make sure that NuGet.exe is in your path&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then you can take two simple steps to generate your package&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;nuget pack MyProject.csproj -IncludeReferencedProjects -Prop Configuration=Release&lt;/pre&gt;
&lt;p&gt;then push your pack to the nuget server, with your APIKey you setup in your web.config of the nuget.server&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;nuget push {package file} -s http://yourNugetServer/ {apikey}&lt;/pre&gt;
&lt;p&gt;That is it, you now have your package available in your own private nuget server.&lt;/p&gt;
&lt;p&gt;For more details on &lt;a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package" target="_blank"&gt;Creating and Publishing a Package&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/05/23/Creating-and-Publishing-to-NuGet.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/05/23/Creating-and-Publishing-to-NuGet.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=c965774e-29f6-40ea-9742-6ddf8ee579c7</guid>
      <pubDate>Fri, 23 May 2014 07:13:00 +0000</pubDate>
      <category>NuGet</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=c965774e-29f6-40ea-9742-6ddf8ee579c7</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=c965774e-29f6-40ea-9742-6ddf8ee579c7</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/05/23/Creating-and-Publishing-to-NuGet.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=c965774e-29f6-40ea-9742-6ddf8ee579c7</wfw:commentRss>
    </item>
    <item>
      <title>Setting up a NuGet Server</title>
      <description>&lt;p&gt;Whether it's your company restricts which third-party libraries their developers may use or just you need your own private repository to store all your protected work. &amp;nbsp;A NuGet Server is what you are after.&lt;/p&gt;
&lt;p&gt;Before I start I need to mention a few things about NuGet Gallery, which I spent a good two days trying to get working correctly on Azure and failed and in the end ended up generating a very basic Nuget Server to host all the libraries.&lt;/p&gt;
&lt;p&gt;This all can be done with just four simple steps&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a new ASP.net Web Forms Application&lt;/li&gt;
&lt;li&gt;Install nuget.server (http://www.nuget.org/packages/nuget.server)&lt;/li&gt;
&lt;li&gt;edit your web.config to set your APIKey&amp;nbsp;&amp;nbsp;&amp;lt;add key="apiKey" value=""/&amp;gt;&lt;/li&gt;
&lt;li&gt;Deploy your application to your website&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That is it, if you fire up your server you should see a screen like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bryanavery.co.uk/image.axd?picture=2014%2f5%2fnuget.server.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;That is it you now have a hosted Nuget Server, next we'll look at deploying your solution to the Nuget Server&lt;/p&gt;
&lt;p&gt;Full details can be found here: &lt;a href="https://www.youtube.com/watch?v=KaEmsdf0oKU" target="_blank"&gt;Host Your Own NuGet Server or How To Create Local NuGet Server&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/05/23/Setting-up-a-NuGet-Server.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/05/23/Setting-up-a-NuGet-Server.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=e2058220-563c-42d2-9e79-16c1cdad76e0</guid>
      <pubDate>Fri, 23 May 2014 06:59:00 +0000</pubDate>
      <category>NuGet</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=e2058220-563c-42d2-9e79-16c1cdad76e0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=e2058220-563c-42d2-9e79-16c1cdad76e0</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/05/23/Setting-up-a-NuGet-Server.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=e2058220-563c-42d2-9e79-16c1cdad76e0</wfw:commentRss>
    </item>
    <item>
      <title>User Stories</title>
      <description>&lt;p&gt;&lt;span style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;Here are some helpful pointers for writing&amp;nbsp;&lt;/span&gt;&lt;span class="il" style="background-color: #ffffcc; color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;User&lt;/span&gt;&lt;span style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="il" style="background-color: #ffffcc; color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;Stories&lt;/span&gt;&lt;/p&gt;
&lt;div style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;
&lt;div&gt;A&amp;nbsp;&lt;span class="il" style="background-color: #ffffcc;"&gt;Story&lt;/span&gt;&amp;nbsp;template&lt;/div&gt;
&lt;div&gt;&lt;ol&gt;
&lt;li style="margin-left: 15px;"&gt;"As a &amp;lt;&lt;span class="il" style="background-color: #ffffcc;"&gt;User&lt;/span&gt;&amp;nbsp;or role&amp;gt;&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;I want &amp;lt;Business Functionality&amp;gt;&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;So that &amp;lt;Business Justification&amp;gt;&amp;rdquo;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Example:&lt;/div&gt;
&lt;div&gt;&lt;ol&gt;
&lt;li style="margin-left: 15px;"&gt;As a Account Holder,&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;I want to be able to withdraw funds from my checking account,&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;So that I can buy some bling.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;
&lt;div&gt;&lt;span class="il" style="background-color: #ffffcc;"&gt;Stories&lt;/span&gt;&amp;nbsp;are not&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li style="margin-left: 15px;"&gt;"mini" Use Cases&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;a complete specification&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;a contract&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;intended to be interpreted without a Product Owner&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span class="il" style="background-color: #ffffcc;"&gt;User&lt;/span&gt;&amp;nbsp;&lt;span class="il" style="background-color: #ffffcc;"&gt;Stories&lt;/span&gt;&amp;nbsp;guidelines&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li style="margin-left: 15px;"&gt;&lt;strong&gt;Testable&lt;/strong&gt;&amp;nbsp;- Tangible acceptance tests can be written against any delivered software&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;The scope of the&amp;nbsp;&lt;span class="il" style="background-color: #ffffcc;"&gt;User&lt;/span&gt;&amp;nbsp;&lt;span class="il" style="background-color: #ffffcc;"&gt;Story&lt;/span&gt;&amp;nbsp;is manage-able enough for the team to provide an&amp;nbsp;&lt;strong&gt;Estimate&lt;/strong&gt;&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;&lt;strong&gt;Independent&lt;/strong&gt;&amp;nbsp;and do not rely on other&amp;nbsp;&lt;span class="il" style="background-color: #ffffcc;"&gt;Stories&lt;/span&gt;&lt;/li&gt;
&lt;li style="margin-left: 15px;"&gt;&lt;strong&gt;Sized appropriately.&lt;/strong&gt;. Have a level of effort which the team can comfortably achieve in the duration of a single iteration&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;More information can be found&amp;nbsp;&lt;a href="http://www.mountaingoatsoftware.com/agile/user-stories" target="_blank"&gt;http://www.mountaingoatsoftware.com/agile/user-stories&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/05/20/User-Stories.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/05/20/User-Stories.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=edc44dfa-3594-4e3f-a785-c18d2882f91d</guid>
      <pubDate>Tue, 20 May 2014 08:30:00 +0000</pubDate>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=edc44dfa-3594-4e3f-a785-c18d2882f91d</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=edc44dfa-3594-4e3f-a785-c18d2882f91d</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/05/20/User-Stories.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=edc44dfa-3594-4e3f-a785-c18d2882f91d</wfw:commentRss>
    </item>
    <item>
      <title>GitHub for web Designers</title>
      <description>&lt;p&gt;Unless you&amp;rsquo;re a one person web shop with no team to collaborate with, you've experienced the frustration that goes along with file sharing. No matter how hard you try, when multiple people are working on a single project without a version control system in place things get chaotic.&lt;/p&gt;
&lt;p&gt;If you work with developers on the build-out and implementation of websites, the merge between front-end templates and back-end functionality can be a scary black hole.&lt;/p&gt;
&lt;p&gt;Issues like overwrites, lost files, and the all-too-common &amp;ldquo;working off a previous version&amp;rdquo; phenomenon crop up constantly. And once back-end functionality has been put into your templates, you become terrified to touch them for fear of breaking something a developer spent a great deal of time getting to work.&lt;/p&gt;
&lt;p&gt;In addition, even if you have a common repository that everyone is pulling from odds are at least one member of your team forgot to grab the latest files and is about to blow things up with their latest additions.&lt;/p&gt;
&lt;p&gt;Fear not GitHub is here to save the day, I&amp;rsquo;ll give you a quick review of GitHub, an excellent version control system.&lt;/p&gt;
&lt;h2&gt;Version Control &amp;ndash; A Quick and Dirty Explanation&lt;/h2&gt;
&lt;p&gt;Version Control (also known as Revision Control or Source Control Management) is a great way to solve the file sharing problem.&lt;/p&gt;
&lt;p&gt;The basic concept is this: there is one main repository for all of the project files. Team members check files out, make changes, and then check them back in (or commit them). The Version Control System (VCS) automatically notes who changed the files, when they were changed, and what about them was new or different.&lt;/p&gt;
&lt;p&gt;It also asks you to write a little note about the change so everyone on the project knows at a glance what you did and why. Each file will then have a revision history so you can easily go back to a previous version of any file if something goes horribly wrong.&lt;/p&gt;
&lt;p&gt;A good&amp;nbsp;&amp;nbsp;Version Control System&amp;nbsp;also allows you to merge changes to the same file. If you and another person work locally on the same file&amp;nbsp;at the same time, when you push these files back into the main repository the system will merge both sets of changes to create a new and fully up-to-date file. If any conflicts arise during the merge it will highlight them for you.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;re probably using a very crude&amp;nbsp;&amp;nbsp;Version Control System&amp;nbsp;right now to keep your files straight. If you&amp;rsquo;re a designer, it looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto;" src="http://www.bryanavery.co.uk/image.axd?picture=2014%2f3%2fdpcwqxg_312gvhkh4s6_b.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;This works well enough for PSDs and other large binary files, which don&amp;rsquo;t really lend themselves to&amp;nbsp;&amp;nbsp;Version Control System. But there&amp;rsquo;s a much better way to do it when you are managing the source code for a website.&lt;/p&gt;
&lt;h2&gt;Benefits to using a Version Control System include:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Files cannot be overwritten&lt;/li&gt;
&lt;li&gt;There is a common repository that holds all the latest files&lt;/li&gt;
&lt;li&gt;People can work on the same files simultaneously without conflict&lt;/li&gt;
&lt;li&gt;Allows you to revert back to an older version of the file/project if needed&lt;/li&gt;
&lt;li&gt;Making your developers very happy&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even if you don&amp;rsquo;t work with a team, version control can be a lifesaver. Backing up files is one of the easiest things you can do to save yourself from losing work or having to start over.&lt;/p&gt;
&lt;p&gt;The idea of a&amp;nbsp;&amp;nbsp;Version Control System&amp;nbsp;seems daunting at first, especially since most of the documentation is written by and for developers. But once you make the move to incorporate it into your workflow, you&amp;rsquo;ll find it&amp;rsquo;s not nearly as hard as it looks.&lt;/p&gt;
&lt;h2&gt;Meet GitHub&lt;/h2&gt;
&lt;p&gt;OK, so now you can see why a Version Control System is a must-have for your web team. If you do a little Googling you&amp;rsquo;ll see that there are quite a few options out there including SVN, Mercurial, CVS, Bazaar and GitHub. Any one of them could be a good solution for your needs, and I encourage you to do some research before selecting a&amp;nbsp;&amp;nbsp;Version Control System. In this article I&amp;rsquo;m going to focus on GitHub, the one I use daily. It&amp;rsquo;s a &amp;ldquo;rising star&amp;rdquo; that has gained&amp;nbsp;popularity thanks to a strong Linux fanbase, GitHub and the Rails community.&lt;/p&gt;
&lt;p&gt;GitHub is a free open-source Version Control System originally created by &lt;a href="http://en.wikipedia.org/wiki/Linus_Torvalds" target="_blank"&gt;Linus Torvalds&lt;/a&gt; for Linux kernal development. Linus is a very smart guy; when he sets out to solve a problem, he doesn't mess around. One of Git&amp;rsquo;s big differentiators is that unlike SVN and CVS it is a distributed version control system. This means that every user has a complete copy of the repository data stored locally on their machine. What&amp;rsquo;s so great about that? A few things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Everything is local&lt;/strong&gt;, so you can work offline&lt;/li&gt;
&lt;li&gt;There is &lt;strong&gt;no single point of failure&lt;/strong&gt;. It doesn't rely on one central server that could crash and burn, taking the only repository for your project with it.&lt;/li&gt;
&lt;li&gt;Because it doesn't have to communicate with a central server constantly,&lt;strong&gt; processes run much faster&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Git has a slightly tougher learning curve than SVN&lt;/strong&gt;, but the trade-off is worth it. Just think how impressed your developer friends will be when you tell them you&amp;rsquo;re using the new hotness that is Git! In all seriousness, I don&amp;rsquo;t think the learning curve is all that steep.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Installing Git isn't fun and games. But there are plenty of resources online to get you through it. It will run on a PC, Mac or Linux box, although installation for Linux and OSX is considerable easier than for Windows.&lt;/p&gt;
&lt;p&gt;You can download the latest version of Git &lt;a href="http://git-scm.com/download" target="_blank"&gt;here&lt;/a&gt;. Once you have the files, try this&amp;nbsp;&lt;a href="http://book.git-scm.com/2_installing_git.html" target="_blank"&gt;quick guide&lt;/a&gt;&amp;nbsp;to get you started with the installation process. For Windows users, this step-by-step &lt;a href="http://nathanj.github.com/gitguide/installing.html" target="_blank"&gt;visual guide&lt;/a&gt; should be helpful. Mac users, try this guide found on &lt;a href="http://github.com/guides/compiling-and-installing-git-on-mac-os-x" target="_blank"&gt;GitHub&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.webdesignerdepot.com/2009/03/intro-to-git-for-web-designers/" target="_blank"&gt;Original Article&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/03/25/GitHub-for-web-Designers.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/03/25/GitHub-for-web-Designers.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=86b6eefd-b517-417f-9997-70e4ac31769e</guid>
      <pubDate>Tue, 25 Mar 2014 08:44:00 +0000</pubDate>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=86b6eefd-b517-417f-9997-70e4ac31769e</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=86b6eefd-b517-417f-9997-70e4ac31769e</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/03/25/GitHub-for-web-Designers.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=86b6eefd-b517-417f-9997-70e4ac31769e</wfw:commentRss>
    </item>
    <item>
      <title>Google authentication get email from ASP.NET Identity</title>
      <description>&lt;p&gt;So how do you obtain the external user email (the one authentication by google), first name and name in an ASP.NET website using ASP.NET Identity?&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;var email = externalIdentity.FindFirstValue(ClaimTypes.Email);&lt;/pre&gt;
&lt;p&gt;and here is getting the type&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;public static string FindFirstValue(this ClaimsIdentity identity, string claimType) 
    {
        Claim claim = identity.FindFirst(claimType);
        if (claim != null) 
        {
            return claim.Value;
        }
        return null;
    }&lt;/pre&gt;
&lt;p&gt;For more information take a look at&amp;nbsp;&lt;a href="http://weblogs.asp.net/jeff/archive/2013/10/03/decoupling-owin-external-authentication-from-asp-net-identity.aspx" target="_blank"&gt;Decoupling OWIN external authentication from ASP.NET Identity&lt;/a&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/03/08/Google-authentication-get-email-from-ASPNET-Identity.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/03/08/Google-authentication-get-email-from-ASPNET-Identity.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=17ace01c-0c5d-464a-98ea-898c38147a6a</guid>
      <pubDate>Sat, 08 Mar 2014 06:47:00 +0000</pubDate>
      <category>ASP.NET Identity</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=17ace01c-0c5d-464a-98ea-898c38147a6a</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=17ace01c-0c5d-464a-98ea-898c38147a6a</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/03/08/Google-authentication-get-email-from-ASPNET-Identity.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=17ace01c-0c5d-464a-98ea-898c38147a6a</wfw:commentRss>
    </item>
    <item>
      <title>WCF Attributes and what they all mean</title>
      <description>&lt;p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px;"&gt;&lt;span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span style="font-size: 14px; line-height: 18px;"&gt;The online MSDN documentation is your first source for things like that:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 14px; line-height: 18px; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Read about the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.aspx" target="_blank"&gt;ServiceContractAttribute&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 14px; line-height: 18px; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Read about the &lt;a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.aspx" target="_blank"&gt;OperationContractAttribute&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size: 14px; line-height: 18px; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Read about the &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx" target="_blank"&gt;DataContractAttribute&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-size: 14px; vertical-align: baseline; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; line-height: 18px;"&gt;&lt;span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span style="font-size: 14px; line-height: 18px;"&gt;All the MSDN documentation pages contain detailed explanations of all the settings on those contract attributes.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/02/02/WCF-Attributes-and-what-they-all-mean.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/02/02/WCF-Attributes-and-what-they-all-mean.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=9b4fb56a-5836-4b89-a70e-5cb616668410</guid>
      <pubDate>Sun, 02 Feb 2014 13:01:00 +0000</pubDate>
      <category>WCF</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=9b4fb56a-5836-4b89-a70e-5cb616668410</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=9b4fb56a-5836-4b89-a70e-5cb616668410</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/02/02/WCF-Attributes-and-what-they-all-mean.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=9b4fb56a-5836-4b89-a70e-5cb616668410</wfw:commentRss>
    </item>
    <item>
      <title>Active links on Bootstrap Navbar with ASP.NET MVC</title>
      <description>&lt;p&gt;If you have used &lt;a href="http://getbootstrap.com/" target="_blank"&gt;Bootstrap&lt;/a&gt; with your ASP.NET MVC application, you might have faced some issues with implementing active links of it&amp;rsquo;s Navbar component. We&amp;rsquo;ll have to dynamically add a css class called active to the particular menu item in order to make it selected in the Navbar. Here is a HtmlHelper extension which is capable of rendering menu items as well as drop-down menu items. I&amp;rsquo;ve used ASP.NET MVC 5 with Razor and Bootstrap 3.&lt;/p&gt;
&lt;p&gt;First step is to create a HtmlHelper extension class.&amp;nbsp;&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;using System.Web.Mvc;

public static class MenuLinkExtension
{
    public static MvcHtmlString MenuLink(this HtmlHelper htmlHelper, string itemText, string actionName, string controllerName, MvcHtmlString[] childElements = null)
    {
        var currentAction = htmlHelper.ViewContext.RouteData.GetRequiredString("action");
        var currentController = htmlHelper.ViewContext.RouteData.GetRequiredString("controller");
        string finalHtml;
        var linkBuilder = new TagBuilder("a");
        var liBuilder = new TagBuilder("li");

        if (childElements != null &amp;amp;&amp;amp; childElements.Length &amp;gt; 0)
        {
            linkBuilder.MergeAttribute("href", "#");
            linkBuilder.AddCssClass("dropdown-toggle");
            linkBuilder.InnerHtml = itemText + " &amp;lt;b class=\"caret\"&amp;gt;&amp;lt;/b&amp;gt;";
            linkBuilder.MergeAttribute("data-toggle", "dropdown");
            var ulBuilder = new TagBuilder("ul");
            ulBuilder.AddCssClass("dropdown-menu");
            ulBuilder.MergeAttribute("role", "menu");
            foreach (var item in childElements)
            {
                ulBuilder.InnerHtml += item + "\n";
            }

            liBuilder.InnerHtml = linkBuilder + "\n" + ulBuilder;
            liBuilder.AddCssClass("dropdown");
            if (controllerName == currentController)
            {
                liBuilder.AddCssClass("active");
            }

            finalHtml = liBuilder.ToString() + ulBuilder;
        }
        else
        {
            var urlHelper = new UrlHelper(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection);
            linkBuilder.MergeAttribute("href", urlHelper.Action(actionName, controllerName));
            linkBuilder.SetInnerText(itemText);
            liBuilder.InnerHtml = linkBuilder.ToString();
            if (controllerName == currentController &amp;amp;&amp;amp; actionName == currentAction)
            {
                liBuilder.AddCssClass("active");
            }

            finalHtml = liBuilder.ToString();
        }

        return new MvcHtmlString(finalHtml);
    }
}&lt;/pre&gt;
&lt;p&gt;Once you have saved it, you can it by just calling like this!&lt;/p&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner"&amp;gt;
    &amp;lt;div class="container"&amp;gt;
        &amp;lt;div class="navbar-header"&amp;gt;
            &amp;lt;a href="#" class="navbar-brand"&amp;gt;Mvc Shop&amp;lt;/a&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;nav role="navigation"&amp;gt;
 
            &amp;lt;ul class="nav navbar-nav"&amp;gt;
                @Html.MenuLink("Home", "Index", "Home")
                @Html.MenuLink("Dropdown", "Index", "Home2", new MvcHtmlString[]{
                                      @Html.MenuLink("Link1", "Action1", "Controller1"),
                                      @Html.MenuLink("Link2", "Action2", "Controller1"),
                                      @Html.MenuLink("Link3", "Action3", "Controller1"),
                                    })
                @Html.MenuLink("JavaScript", "Index", "Home1", new MvcHtmlString[]{
                                      @Html.MenuLink("Link1", "Index1", "Home1"),
                                      @Html.MenuLink("Link2", "Index2", "Home1"),
                                      @Html.MenuLink("Link3", "Index3", "Home1")
                                    })
 
            &amp;lt;/ul&amp;gt;
        &amp;lt;/nav&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/header&amp;gt;&lt;/pre&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2014/01/20/Active-links-on-Bootstrap-Navbar-with-ASPNET-MVC.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2014/01/20/Active-links-on-Bootstrap-Navbar-with-ASPNET-MVC.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=171848c9-5005-417d-9988-1ef3e96d53ae</guid>
      <pubDate>Mon, 20 Jan 2014 14:06:00 +0000</pubDate>
      <category>MVC</category>
      <category>Bootstrap</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=171848c9-5005-417d-9988-1ef3e96d53ae</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=171848c9-5005-417d-9988-1ef3e96d53ae</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2014/01/20/Active-links-on-Bootstrap-Navbar-with-ASPNET-MVC.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=171848c9-5005-417d-9988-1ef3e96d53ae</wfw:commentRss>
    </item>
    <item>
      <title>How to Rank your search results with multiple search terms using LINQ and EntityFramework</title>
      <description>&lt;p&gt;I have always used a ranked search criteria, it's the only true way to get good results back from a data set. &amp;nbsp;But I've been doing my ranking within C# code. &amp;nbsp;But this got all the data from the data source and then ranked the results. &amp;nbsp;This is very poor on performance, as we should only be returning back the results for the page size we require.&lt;/p&gt;
&lt;p&gt;So task at hand it to produce a LINQ statement to reterive only the data you require.&lt;/p&gt;
&lt;p&gt;Here is the solution:&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;var entity = new myEntities();

var searchTerm = "a b Ba";

var searchArray = searchTerm.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

var usersAll = entity.User.AsExpandable().Where(TC_User.ContainsInLastName(searchArray));

Console.WriteLine("Total Records: {0}", usersAll.Count());

var users = usersAll
    .Select(x =&amp;gt; new { 
        x.LastName, 
        Rank = searchArray.Sum(s =&amp;gt; ((x.LastName.Length - x.LastName.Replace(s, "").Length) / s.Length)) });

var results = users.OrderByDescending(o =&amp;gt; o.Rank)
    .Skip(0)
    .Take(20);

foreach (var user in results)
{
    Console.WriteLine("{0}, {1}", user.LastName, user.Rank);
}

Console.ReadLine();&lt;/pre&gt;
&lt;p&gt;You'll also need to add a new method to your User class to check for that the search term is contain in the LastName&lt;/p&gt;
&lt;pre class="brush: c-sharp;"&gt;public static Expression&amp;lt;Func&amp;lt;TC_User, bool&amp;gt;&amp;gt; ContainsInLastName(
                                                params string[] keywords)
{
    var predicate = PredicateBuilder.False&amp;lt;TC_User&amp;gt;();
    foreach (string keyword in keywords)
    {
        string temp = keyword;
        predicate = predicate.Or(p =&amp;gt; p.LastName.Contains(temp));
    }
    return predicate;
}&lt;/pre&gt;
&lt;p&gt;One thing that is required is &lt;a href="http://www.nuget.org/packages/LinqKit/" target="_blank"&gt;LinqKit&lt;/a&gt;, which is available via NuGet to handle the&amp;nbsp;PredicateBuilder and&amp;nbsp;AsExpandable.&lt;/p&gt;
&lt;p&gt;Watch out as the results coming back from Sum is a BigInt so if you create a model to return back make sure it is a long type.&lt;/p&gt;</description>
      <link>http://www.bryanavery.co.uk/post/2013/12/31/How-to-Rank-your-search-results-with-multiple-search-terms-using-LINQ-and-EntityFramework.aspx</link>
      <author>b_avery@yahoo.com</author>
      <comments>http://www.bryanavery.co.uk/post/2013/12/31/How-to-Rank-your-search-results-with-multiple-search-terms-using-LINQ-and-EntityFramework.aspx#disqus_thread</comments>
      <guid>http://www.bryanavery.co.uk/post.aspx?id=8aca0bd2-009f-42c5-9207-1878db5b9389</guid>
      <pubDate>Tue, 31 Dec 2013 11:59:00 +0000</pubDate>
      <category>C#</category>
      <category>LINQ</category>
      <category>LINQ2SQL</category>
      <category>SQL</category>
      <dc:publisher>Bryan</dc:publisher>
      <pingback:server>http://www.bryanavery.co.uk/pingback.axd</pingback:server>
      <pingback:target>http://www.bryanavery.co.uk/post.aspx?id=8aca0bd2-009f-42c5-9207-1878db5b9389</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.bryanavery.co.uk/trackback.axd?id=8aca0bd2-009f-42c5-9207-1878db5b9389</trackback:ping>
      <wfw:comment>http://www.bryanavery.co.uk/post/2013/12/31/How-to-Rank-your-search-results-with-multiple-search-terms-using-LINQ-and-EntityFramework.aspx#disqus_thread</wfw:comment>
      <wfw:commentRss>http://www.bryanavery.co.uk/syndication.axd?post=8aca0bd2-009f-42c5-9207-1878db5b9389</wfw:commentRss>
    </item>
  </channel>
</rss>