Breaking Into Your Lambda

I just learned something new today at Microsoft Virtual Academy.  Heck I almost always learn something new or even things I forgot at Microsoft Virtual Academy.  In this case I thought it was pretty neat.  We all use break points throughout our code, most of the time I just break on a line.  I just learned how to break into a Lambda expression.

Basically you click inside your Lambda expression and then press F9.  To show this I will create a quick class called Stuff.

    public class Stuff
    {
        public string Name { get; set; }
        public int Quantity { get; set; }
    }

In another area I am going to use this class to create a List<Stuff> and then use a Lambda on that list.

            List someStuff = new List()
                            {
                                new Stuff{Name = "Dice", Quantity = 2}, 
                                new Stuff{Name="Cards", Quantity = 52}, 
                                new Stuff{Name = "Tokens", Quantity = 20}
                            };

            var result = someStuff.Where(s => s.Name.Length > 4);

Next I click in my Lambda and press F9, below is a screenshot of the break point inside my Lambda.

Breaking Into Lambda

My Last Three Exams

To take advantage of my 3 for 1 voucher I have to have all of my exams scheduled by May 31st. This makes me a little nervous about hitting my goal in time.   I plan to do my best to hit this goal though.

Test

Name

Brief Description

More Information

70-480 Programming in HTML5 with JavaScript and CSS3 This exam measures your ability to accomplish Implement and manipulate document structures and objects, Implement program flow, Access and secure data, Use CSS3 in applications. http://www.microsoft.com/learning/en-us/exam-70-480.aspx
70-486 Developing ASP.NET MVC 4 Web Applications This exam measures your ability to Design the application architecture, Design the use experience, Develop the user experience, Troubleshoot and debug web applications, Design and implement security.

 

Starting April 30, 2014, the questions on this exam will include content covering Visual Studio 2013, MVC5, and updates to Windows Azure.

 

http://www.microsoft.com/learning/en-us/exam-70-486.aspx
70-487 Developing Windows Azure and Web Services This exam measures your ability to accomplish Accessing data, Querying and manipulating data by using the Entity Framework, Designing and implementing WCF Services, Creating and consuming Web API-based services, Deploying web applications and services.

 

Starting April 30, 2014, the questions on this exam will include content covering Visual Studio 2013 and updates to Windows Azure.

 

http://www.microsoft.com/learning/en-us/exam-70-487.aspx

MTA Obtained

The first real step towards my MCSD has been successfully completed. Today I earned my MTA for Web Development! I was really nervous, I have never taken any certification exams and how humiliating would it be if I failed. After all, I have been a Web Developer for over 13 years. Now the harder parts; MVC, Azure, and HTML5 with JavaScript.

These last three tests will be a bit more challenging for me personally. As a developer in a corporate environment you tend to get pigeon holed into what works. Not just what works but can be completed quickly and securely developed. If you want to branch out you really need to do a lot outside of work, after all you do not want work projects to be your learning projects. I have been doing MVC, but personally I do not feel I am as strong with it as I would like. Azure, I have only done some tutorials and Microsoft events; we do not use Azure at work. HTML5 with JavaScript, not all users at work are using a good browser for it yet, and to be frank the need for straight HTML5 and JavaScript just doesn’t come up. I have been trying to use some HTML5 in my MVC projects though.

So, I will be doing more tutorials, videos from Microsoft Virtual Academy, and of course studying.

Debugging A Silverlight Project With Windows 7 & VS2012

This is something I tend to forget from time to time.  When I look on the Internet I do find some help but the names do not line up exactly the same for me.  For this post I am using Windows 7 and Visual Studio 2012.

With Silverlight, if you start it in debug mode you may end up debugging the client or the server.  I find it much easier to do the following.

  1. Start Internet Explorer, I suppose you could use any browser of choice but for Silverlight debugging I prefer to stay in IE.
    1. Browse to your Silverlight application using http://localhost&#8230;.  I get that url by running it in Visual Studio and just adding it to my favorites.
  2. In Visual Studio click on the Debug menu item at the top, then click on Attach to Process.
  3. There are three processes I attach it to:
    1. iexplore.exe
      1. Two of these, one is listed with the title of the Silverlight home page the other has a type of Silverlight
    2. w3wp.exe
      1. For my environment this has a Type of Managed and a User Name of IIS APPOOL\DefaultAppPool
  4. You may receive an Attach warning (see image below).  You selected this and know what it is so click Attach.

Image

For me that’s it, I’m now debugging a large Silverlight 4 application and hitting my various break points.  I hope this helps some people other than just me.

Microsoft’s Certification Challenge 2014

Microsoft has done things like this before and I just let it slip on by me.  This time will be different.  While I have been doing web development for many years I never bothered to earn any kind of certification.  This year I am going to make a run at it.  Hopefully I will not be a public failure, but as I take tests and get the results I will post about my experience.

For now I am going to take the certification path one step at a time.  Step one, obtain at least one MTA.  For me this will be the MTA for Web Development Fundamentals.  I am not so arrogant as to assume I know everything, so I am going to make use of the course, Software Development Fundamentals, at Microsoft Virtual Academy.

If you are interested in taking up the challenge as well, head on over, and take up the challenge.

Certification Challenge

Certification Challenge

 

A Good MVC Database First Tutorial

I know there are a lot of examples out there of MVC Code first, but there does not seem to be a whole bunch on Database first.  I did find a really nice one, even though it is a bit old.

Julie Lerman had created a post about Building an MVC3 with Database First and Entity Framework 4.1.

This simple tutorial still applies today, I just did it with Visual Studio 2013 so that would be MVC5 and Entity Framework 6.  There are just a couple gotchas.

Generating Strongly Typed Entity Class

This is the first gotcha.  I picked the EF 6.x DbContext Generator.  Then I discovered that the Model1.Context was redundant so I had to delete it.  I kept the Model1.tt though.

Running the Application

This one was really easy to fix.  In the Global.asax you will find that MVC5 uses the various config.cs files located in the App_Start folder.  So instead of editing your routes in Global.asax just edit them in RouteConfig.cs in the App_Start folder.

There might be better ways to fix these gotchas, especially that first one.  The thing is it worked and is a great little DB First tutorial.

I Cannot Add Callisto to Contoso Cookbook

Bob Tabor does an excellent job teaching material to developers.  While he does have his own business he also has done a number of series for Microsoft’s Channel 9.  Two of his series he put up that I wanted to go through are for Windows 8 App development; C#/XAML and HTML/CSS/JS.  I just cannot find the time to complete them.

Last night I sat down to start the C#/XAML one; recently at work I have been moved to a Silverlight project so becoming familiar with XAML is a good idea.  One of the first things you do is open the Contoso Cookbook solution and try to build it.  You’ll get an error about a Callisto reference.  If you try to use the package manager like he does in the video you will get an error.  While these videos are not even a year old, I know things have changed.  Below is the error message I received.

Could not install package ‘Callisto 1.4.0′. You are trying to install this package into a project that targets ‘.NETCore,Version=v4.5′, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

The fix is pretty simple if you use Nuget a lot.  You use the Package Manager Console and type the command to install the version of Callisto you need.

PM> Install-Package Callisto -Version 1.2.4
Installing ‘Callisto 1.2.4′.
Successfully installed ‘Callisto 1.2.4′.
Adding ‘Callisto 1.2.4′ to ContosoCookbook.
Successfully added ‘Callisto 1.2.4′ to ContosoCookbook.

Build, and there you go.

Using LINQ to Sort by Day of Week And Time

So a couple weeks ago I saw a question on the ASP.Net or MSDN forums.  Someone wanted to know how to use LINQ to sort by the day of the week and then by the time for a given datetime.  I did not have a chance to do anything with it, but for some reason it stuck in my head.  So, I came up with the answer, but of course I do not remember where the post was located.  The answer is very simple.

Read the rest of this entry

The WSDL Tool

The WSDL tool is a handy tool to generate a proxy class to consume a web service.  There is plenty of information out there about it, so I will not go into detail.  I will provide some links though.  One bit of advice is to add a new Environment Variable to your machine.  Here is an example, I named mine Path.

Variable name: Path

Variable value: %PATH%;C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin

You may need to verify that path on your actual machine, it should be the location of wsdl.exe.

Web Services Description Language Tool on MSDN.

From Troy Hunt – The beginners guide to breaking website security…

This post should motivate some people to be more security minded.  I know I am not perfect but I did not realize all of the capabilities that are shown in this post.  Mainly the ability for it to use the name of one of your trusted networks.

http://www.troyhunt.com/2013/04/the-beginners-guide-to-breaking-website.html

Follow

Get every new post delivered to your Inbox.

Join 199 other followers