Tuesday, 5 August 2014

SmartObject

Transaction Support in Service Instances

               All Service instances are instantiated and executed as part of a Transaction Scope in the SmartObjectBroker. The transaction option as specified on the SmartObject method determines the TransactionScopeOption.

We have three options:

  1. Continue: TransactionScopeOption = Suppressed - No transaction, all services (execution blocks) will execute even if one or more fail.
  2. Stop: TransactionScopeOption = Suppressed – No transaction, execution will halt immediately after first service execution fails.
  3. Rollback: TransactionScopeOption = Required – A root transaction is created and will be the relating transaction for all participating services to obtain in.
The concept of Transaction Scope and ambient transactions is clearly explained in the following article 

Saturday, 2 August 2014

Introduction to ASP.NET vNext


ASP.NET MVC which will be version 6 and is code named vNext.  

     Here are the main features summarized:

  1. Optimized for Cloud and on premise servers.
  2. ASP.NET MVC and Web API have been merged into a single programming model.
  3. New JSON based project structure.
  4. No need to recompile for every change. Just hit save and refresh the browser. Compilation done with the new Roslyn real-time compiler.
  5. Dependency injection out of the box.
  6. Side by side deployment of the runtime and framework with your application.
  7. Everything packaged with NuGet, Including the .NET runtime itself.
  8. vNext is Open Source via the .NET Foundation and is taking public contributions.
  9. vNext (and Rosyln) also runs on Mono, on both Mac and Linux today.
    I especially like the fact that WebAPI is being merged with MVC as this will make a much easier and cleaner framework to use for full stack development. Rest based API’s are now pretty much the in-thing when it comes to programming your back-end, so it is good to see that Microsoft are making things easier.

You can get more information from the official  Microsoft vNext site. 

How to fix your asp.net site to be responsive on windows phone


       There is a well-known bug on Internet Explorer 10 for Windows Phone 8 that avoids responsive web sites to display correctly. 
            The cause is that Internet Explorer 10 doesn't differentiate device width from viewport width, and thus doesn't properly apply the media queries in your favorite responsive CSS framework (for example Twitter Bootstrap ).

         Be careful that if you're testing the web site using mobile emulators, may be you'll not be able to experiment the bug. You have to use a real Windows Phone (e.g. Nokia Lumina).


        To fix it on the client side you have to add CSS and JavaScript declarations in all your pages, but if you are using ASP.NET, you can add the following lines of code in your master page and the whole web site will be fixed.


public partial class SiteMaster : MasterPage
{
    public void FixWinPhoneIE10Responsiveness(Page page)
    {
        // Build the base style declaration
        var style = new StringBuilder(
            "<style type=\"text/css\">" +
            "@-moz-viewport{width:device-width}" +
            "@-ms-viewport{width:device-width}" +
            "@-o-viewport{width:device-width}" +
            "@viewport{width:device-width}");
        // If the request comes from IE10 on Windows Phone add an additional declaration
        var browserCapabilities = page.Request.Browser;
        if (String.Compare(browserCapabilities.Browser, "IEMobile",
            StringComparison.OrdinalIgnoreCase) == 0 &&
            browserCapabilities.MajorVersion == 10 &&
            browserCapabilities.MinorVersionString == "0")
            style.Append("@-ms-viewport{width:auto!important}");
        style.Append("</style>");
        // Add the style declaration in the page head section
        var placeholder = new Literal {Text = style.ToString()};
        page.Header.Controls.Add(placeholder);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        FixWinPhoneIE10Responsiveness(Page);
    }
}

What is AngularJS?

                    
                          AngularJS is a JavaScript framework that is used for making rich, extensible web applications. It runs on plain JavaScript and HTML, so you don't need any other dependencies to make it work, and it is CSS-agnostic so you can use whatever CSS framework/methodology you want when designing your Angular application.

click on this link for more information. Getting Started

Getting Started with ASP.NET MVC 5

This tutorial will teach you the basics of building an ASP.NET MVC 5 Web application using Visual Studio 2013.      Getting Started with ASP.NET MVC 5