Memory dumps of a developer

Articles and tutorials on .NET Core, ASP.NET MVC, Kendo UI, Windows 10, Windows Mobile, Orchard

  • Dictionary Initializers in C# 6.0

    Dictionary initialization was first introduced with C# 3.0 and the syntax for the same remained same since then.

    In C# 6.0 the syntax was tweaked little bit to make it more friendly to maintain. As we all know in a dictionary object, information is stored as key value pairs and if you look at the above syntax a lot of curly brackets and punctuation marks are used. This makes it pretty ugly and doesn’t reflect the data structure which is holding the data.

    The new syntax reduces the number of keystrokes and the code is now more elegant and readable by omitting some curly braces and the syntax now uses the equals sign which helps you to recognize the info in a key value pair format

    Even though they have introduced a new way on initializing dictionary objects, the old way of writing is still valid and it’s up to you developers to use which one.

  • String Interpolation in C# 6.0

    Up untill now we are using various options for formatting strings using String.Format or by concatenating string values using + operator or String.Concat function. 

    In the case of using + operator , as the number of items that needs to concatenated increases it becomes very hard to maintain and to understand what we are doing and some times it may result in incorrect string ouput too.

    This can be solved to some extent by using the String.Format function by using the literals as placeholders so that we will get to know what the output be in advance by looking at the text part. But here we may find problems if we don't give the parameter values in the same order as in the string text part. Also if the number of placeholders and the values in the parameter list are not in sync an exception will be thrown at runtime.

    In C# 6.0, Microsoft added a new feature to make our life easier by allowing us to put the expressions directly in the string literal. Now we can inject the values into a string using curly bracket enclosed expressions.

  • Null Propagation Operator in C# 6.0

    Every developer who writes C# code should have encountered NullReference exception or Object Reference not set to an instance of an object error at least once. This error normally happens when you try to invoke a member of an object without performing a null check on the object. For example the following code will produce a compiler error


    So normally to solve this issue we will introduce a conditional checking before invoking the property as shown below


  • Invoking server method from client using SignalR

    In this series I will show you people to how to invoke a method defined in the server side code from javascript and then invoke a method in the client side to show the message returned by the server code. In the earlier post, I have explained in detail the various the steps needed to incorporate SignalR in your project and you read that here if you want to recollect it.

  • Getting started with SignalR

    SignalR is a library from Microsoft which can be used for enabling real-time functionality in your web applications. SignalR uses web sockets feature in HTML5 to maintain a persistent connection between the server and the client. Because of the stateless nature of the web, it was very hard to maintain a persistent connection in the pre HTML5 era and we used techniques such as long polling, meta refresh tag or some timer logic coupled with AJAX calls to achieve it. Please visit their site or in GitHub to read more on the features and documentation, also the entire code is available there.

    SignalR API contains two methods for communication between client and server

    1. Persistent Connections - Represent a single endpoint for sending single-recipient, grouped or broadcast messages. It’s similar to communication based API’s such as WCF.

    2. Hubs - Built upon the Connection API that allows the client and server to call methods on each other directly.Similar to other remote invocation API’s such as .NET Remoting




    Picture Courtesy : SignalR Documentation

  • D - Day : Welcome to the Windows Era

    With the clock now past the midnight to ring in July 29th, Microsoft went live with the release of Windows 10 worldwide in 190 countries and in 111 languages. The upgradation will start in each country by  12.00 AM and the rollout process will happen in batches and in a staged manner, so those who reserved their copies don't get worried about the upgrade for the time being, it will be coming to your machines very soon. Also the links for ISO files are also now live, but the catch here is that you will need the serial number during the installation process, for those who have that right now they can proceed with the installation using the iso files. The instructions and links for the iso files can be found here.

    Currently there is a workaround for those who have reserved the copy for Windows 10 and yet to see the update, please find this post in the Windows Central site. I haven't tried this one yet, so proceed with this at your own risk if have ran out of patience. In the meantime you go through these links which has in depth reviews, tip and tricks, help guides etc

    1. Windows 10 FAQ
    2. Windows 10 Official Blog
    3. Windows 10 review by Windows Central
    4. Review by
    5. Windows 10 Quick Guide
    6. Windows 10 Help, Tips & Tricks
    7. Articles by Tech Repository on Windows 10
    8. Nine Important Things in Windows 10 by The Verge

    Watch this space for more on my upgradation experience and till then have fun with the ninja cat

  • D-01 : Windows is Free

    This one statement was the biggest surprise from Microsoft since they announced their plans to release the next version of Windows to the masses. Yes, you heard it right, they are giving it free for all for a year from the date of the launch and anyone wishes to install after that will need to shell out some money. They will be providing support and unlimited access to updates also for those who jumped in the first year too.

    The dwindling sales of the desktops and laptops as well as the poor response to previous version may have forced Microsoft to take this step. But as more and more services and enterprises embracing the cloud and the future plans for Windows as a Service will help Microsoft to gain the lost ground in the long term.

    So do I need to really really upgrade even if the offer is tempting ?

    Windows XP, Vista

    If you are running on Windows XP, then you should really upgrade it. We all know it was one of the best product to come out of Microsoft, but it has reached the end of the life cycle long back and also it was developed prior to Web 2.0 and there are many shortcomings in the OS to run in the modern web era.

    Windows 7

    If you are running on Windows 7, then it will be a difficult option to switch. If you are okay with the OS, then there is no need to upgrade right now. Windows 10 still has some feature from Windows 8.0/8.1 and if you are not going to use any one of them, then stick with the current one. But if you want to exploit the under the hood features of Windows 8 such as faster boot up time, improved task manager, one drive syncing and additional features such as Cortana, Virtual Desktops , then go for it. You won't find much difference between the two softwares and will get you going from the day one itself.

    Windows 8/8.1

    Should upgrade. Windows 10 removes most of the annoying things in Windows 8/8.1 and it's now much more user friendly for non-touch input when compared to the previous version. 

    Also the free upgrade can be done only for the ones having a valid license of Windows XP/7/8. If you are running a pirated version then Microsoft will allow you to upgrade to Windows 10, but still it will be an unlicensed one.

  • D-02 : Windows 10 Editions

    As we all know that Window 10 is slated for release on July 29 in 190 countries and 111 languages. The new incarnation of Windows is designed to run on a variety of devices such as Surface Hub, Desktop. Laptop, Tablets, Phone, XBOX, Holo Lens and also on IoT devices. To cater these devices Windows 10 comes in various flavours and let's take a look on each one of them.

    Windows 10 Home

    Targeted for home consumers, runs on desktops, laptops, tablets and 2-in-1s. Will have Cortana, Edge, Continuum support, Windows Hello, universal apps such as Photos, Mail, Calendar, Music and Video.

    Windows 10 Mobile

    Designed for smaller devices such as mobiles, smart phones and phablets, does have all the universal apps from the home edition as well as touch centric Office app. It does support continuum to use their phone like a pc if the device meets the hardware requirements

    Windows 10 Pro

    Desktop editon for desktops, laptops, tablets and 2-in-1s. Has many extra features built on top of home edition and is suitable for small business. Will have support for the new Windows Update for Business which helps to reduce management costs, controls over updates installation and offers quicker access to security updates.

    Windows 10 Enterprise

    Ideal for medium and large businesses, available for Volume Licensing customers, supports Windows Update for Business and have access to Long Term Servicing Branch as a deployment option

    Windows 10 Education

    Built on top of Enterprise version, designed to meet the needs of schools and various academic institutions, available through Academic Volume Licensing

    Windows 10 Mobile Enterprise

    Designed for business customers on smartphones and phablets, available for Volume Licensing Customers, offers great productivity, security and device management capabilities and flexible ways to manage updates.

    Windows IoT Core

    Designed for small footprint, low cost devices like gateways

    There will also be seperate versions of Windows 10 Enterprise and Windows 10 Mobile Enterprise for devices like ATMs, POS, Handheld Terminals and Industrial Robotics

  • D-03 : Windows Insider App

    The Windows Insider program was launched by Microsoft to onboard people who were interested in trying out the latest operating system from them. Since the debacle of Windows 8, Microsoft also wanted to erase all the negativity surrounding their flagship product. So instead of releasing beta version now and then, the users needed to get registered with them in the Windows Insider program site to get hold of the future builds for Windows 10. As time went on Microsoft released an universal app for the program, which enabled the users to get access to the notifications and announcements as part of the core experience itself. In the earlier builds the app was available for download from the store itself, but with the recent builds the app became part of the OS itself and now can be installed from optional features section. The insider app will not be installed by default and users needs to manually install them if he wants to be a part of the insider program.

    You can add an optional feature from the Settings app and in this case I am using the search functionality in the app to add a new feature. Clicking on the Add a optional feature in the search list will take you to the Manage Optional features page from where the user will have the option for adding.

  • D-05 : Get in touch with Microsoft using the Feedback App

    Windows 10 now includes a feeback app, again an universal one for sending you suggestions and issues directly to Microsoft rather than through websites or forums. The app has two sections, all the categories will be listed in the left side and right side has a panoramic control which list the topics in different categories such as Trending, Most Recent and Upvotes. Additional options include searching for topics by typing in the box provided and also for filtering the resultset.