Installing from Local NuGet Respository

A timesaver in using NuGet packages is using the local NuGet cache to install packages to Visual Studio Projects after the package is downloaded first time from NuGet.org.

Everytime we download a NuGet package, it is stored locally in C::\Users[username]\AppData\Local\NuGet\Cache.

Scott Hanselmann has a great post on using this technique to install NuGet packages from local cache once the package is downloaded first time from visual studio.
http://www.hanselman.com/blog/HowToAccessNuGetWhenNuGetorgIsDownOrYoureOnAPlane.aspx

In you case want to create a local repository which you can access from multiple PC’s, you can create a local directory and configure it is a source package in Visual studio. In this you can access all your local repositories from a central location. More about this can be found at https://joshilewis.wordpress.com/2012/01/13/creating-a-local-nuget-cacherepository/

These are great time savers in adding NuGet packages repetedly to project in visual studio. In case you have slow internet connection, this is a godsend.

Advertisements

Learning Querying in Entity Framwork – Tips 1

Learning to write queries in Entity Framework is key to leverage the benefits provided by Entity Framework.

Some utilities which can help us on the journey are:

  • Object Dumper
  • Printing the SQL generated by Entity Framework

Object Dumper

This is the Microsoft utility to dump result of linq queries as an object graph. This is a great utility to see the results from a linq query. We can use object dumper to print out the results of query from Entity Framework to console. In case you want to see the output in a single file, call the method which has the Entity Framework query from a MsTest test case. There is a TestContext property which can capture the console output which can be viewed in the test results pane of MS Test.

Dumping SQL Query generated by Entity Framework

Entity Framework 6 has a neat utility to print the SQL generated by Entity Framework for the query given. Just call ToString on the variable containing the query. This will print the SQL generated to the console.

The above 2 utilities are of great help while learning querying in Entity Framework.

A sample code listing using the above two tips is given below:

public void GetCustomerMini()
        {
            using (var context = new AWEntities())
            {
                var query = from c in context.Customers select new {c.CustomerID, c.FirstName, c.LastName};
                var customer = query.ToList();
                var sql = query.ToString();
                Console.WriteLine("SQL: {0}", sql);
                Console.WriteLine("Count: {0}", customer.Count());
                ObjectDumper.Write(customer);
            }
        }

you can call the above method in MSTest test method and using TextContext property have the console output captured as part of test result.

Linqpad can also make this simpler. But for people who like visual studio the above 2 utilities are of great help

Career Crisis in IT Technology Industry

Why is keeping up to date with fast moving technology so hard?

Most of us from offshore Indian companies work in low end maintenance projects. The Techology we work is old, the work routine and some mission critical systems require a lot of attention for support. Over a period of time when we see the new technologies we feel as if we are from stone age.

Here are few challenges I seen in my career:

  • When we are young we master simple things quickly. We have a lot of energy and are gumtption. We feel as if we know all. But in reality we are only seeing tip of the iceberg
  • As we get older we fall into the other issues politics, slowing career growth, personal and professional setbacks etc. We start feeling things are not greener as we thought
  • We stop learning once we reach a comfort level and then with what we know we don on the role of experts. How ever we have always been standing on top of leaky abstractions
  • We lose touch with programming and our mental skills start slowing down
  • It looks like we have to start learning right from the basics as we have lost many cycles of technology updates
  • When we see other people growing faster than is and young people just mastering a new technology faster we feel lost and let down. “Why me”, “Am I valuable” feelings start to rule our mind
  • Not having strong support network or emotional balance we have breakdown or fall into addictions which lead us farther down the pit
  • We start thinking whether we should make a career change. But what are we to do? What kind of skills we need? How do we make the job change etc etc are issues which grapple us
  • Can we make the same high salary we made previous. If the current job is dead end and makes us sick and we dont feel like working how do we meet our financial committments

The above are some of issues which I feel confronts us at some point in our life.

I have to some extent solved the above issues I have faced in my life. I will be blogging about these so that others can take recouse from what I have done.

Learning Entity Framework

ORM is becoming used increasingly in projects as we want to get rid of SQL development which needs database skills and reliance in DBAs who are already over loaded. Microsoft’s Enity Framework has become a matured product and is the data access methodology suggested by Microsoft.

However Entity Framework has a huge learning curve and there are not much information available on using it. Julie Lerman has some good books and video courses in Pluralsight.

I have not had much success in my attempts for learn Entity Framework partly because I could not put it to use in a real time project.

Now I am tyring to see how to use Entity Framework in some OS projects.

The following are some courses in Pluralsight which are related to Entity Framework and which I plan to go through. I will also write some blog posts on my learning experience.

  1. Entity Framework 4.0 By Example
  2. Entity Framework and Data Models
  3. Designer Supported EDM Customization
  4. Querying the Entity Framework
  5. Entity Framework 4.1 – Code First
  6. Entity Framework 4.1 – DbContext Data Access
  7. Entity Framework Code First Migrations
  8. Data Layer Validation with Entity Framework 4.1+
  9. Entity Framework in the Enterprise
  10. Getting Started with Entity Framework 5
  11. Entity Framework 6: Ninja Edition – What’s New in EF6

You can browse through the courses using following link in Pluralsight

Learning Bootstrap

Just started learning bootstrap using the Pluralsight course Introduction to Bootstrap by K Scott Allen.

I have fallen in love with Bootstrap. CSS was really a pain area for me and I had a lot of failure attempts trying to read CSS from books. Bootstrap has really changed my perception of CSS.

The documentation of Bootstrap is awesome. Neat and clear examples explain how to use the various bootstrap features. The documenation is the main reason I fell Bootstrap has been adopted by so many people.

I will be spending some more time learning and experimenting with bootstrap and will share more about this in future posts.

Unit Testing with NUnit

Unit testing using testing frameworks is a very important activity for any developer. With the nature and types of testing ever under the rise, it becomes important to use automation where ever possible.

Even though there are lot of unit testing frameworks, the simplest and the easiest to user for many scenarios is Nunit.

Though Microsoft has its own MSTest framework, it falls short in terms of the API and the learning materials tutorials for using it. Surprisingly this is one area which is under documented in Microsoft space.

Though there are lots of tutorials to get started with NUnit, I have found the following very good to start with:

Pluralsight Course: Introduction to .NET Testing with NUnit

For samples the best I have seen is the nunit-csharp-samples.

I will also share some of the good scripts and samples I see in forthcoming blogs.

Some Simple things to be an Outlier Developer

Cory House Outlier developer course provided covered the key items which are required to become an outlier developer.

In this post, I want to share with you all some simple things which I have learntover a period of time in my career and which I felt makes sense as an addon to becoming an outlier.

First things First

All of us have aspirations, dreams and also to some extent greed due to lack of knowledge. We really confuse between wish and need and chase up lot of unwanted items only to find that the journey was not worth it when we finally got the result.

Becoming an outlier developer requires a huge amount of effort, motivation and discipline. The intense focus on some of the areas means that we end up focusing less on some of the other key areas in life. There will be failures and personal set backs. In moments like them, we need to take a though decision and really focus on “First things First”. We need to do what is right under that circumstance. That may mean for some time taking a back seat from our main focus area. We should know when to stop when there is no benefit in putting extra effort or we know that we need other things at that point than being an outlier developer.

A key thing is to have a supporting family, a select network of friends whom we can lean upon and above all good spiritual support so that we can weather the rough storms we may face in life.

Having the above things first makes sure we enjoy our process of becoming an outlier developer better.

Having a leaning plan and documenting results

As we get older for want of time and the daily pressures, we will not be able to spend more time and intense effort on our learning journey. Under such circumstances we need to
have a flexible plan. It is also important that we takes notes of what we learn and revise it often.

With the growth in digital tools we spend less time taking manual notes. I feel that manual note taking process is very important and we should also have this in parallel to digital note taking. Drawing diagrams and looking at things from different view point and trying to related what we learn to things we already know makes sure that we retain the information we learn better.

I also think we should have a quarterly or annual learning outcome report where we document our key learning in our personal and on the job learning. Business confidential information can be left off but the key lessons in generic terms can be share with other.

A very good example of learning outcome report is from the blog of Rama Kanneganti. Though his About me page looks simple and highlights less of his technical accomplishments, he is one of the best thought leader, I have seen among IT architects.

In his blog article 2014 a Personal technology journey, he has shared key learning outcomes across various technologies. This is one a good way to document our learning to be shared with our friends and colleagues.

In fact we can even prepare a quarterly learning report to document our learning outcomes.

Rama also has authored many interesting articles which are a good read. What does it take to become an architect is a good post and an essential read for any architect.

Looking at the big picture

Today’s work life is in some cases chaotic and filled with conflicts. There will be frustrating times and we need to handle some sticky stakeholders. There arises a need to step back, not lose sight of the big picture handle things tactfully.

We must see the role we play and its importance to the big picture. Looking at our role from a larger perspective helps us to handle many of the strifes we face in day to day life much better.

Blogging about how our work impacts the industry we work on is also another way to enlarge our perspective.

Simple advises for being better programmer

There are a lot of articles on the web on how to be better programmer. Though a lot of articles lack originality, there are really some good posts from people famous and really simple. I have been bookmarking them for the past 4-5 years and I maintain a list of really wonderful posts in this lisly list. We can follow what feels best for us.

Read widely

It is also important that we read on other non technical areas like listening skills, lateral thinking, creativity, visual problem solving, art, history, etc.

Reading widely keeps our minds open and keeps our interests alive.