Category: Microsoft Certification Exam

Learn, Prepare yourself (Guide for U.S Immigrants)


 

Getting started:

This is one of the few careers that is highly pay and you don’t need a licence though, but you need to prove that you know and are able learn and perform the job with high standards. That’s the biggest advantage of the software developer career or related fields you don’t need a degree certificate, a diploma or a license to be able to work on this field, your knowledge and your experience should be sufficient to be able to find a job. I’m not saying that trying to get a degree is bad, if you want to go to the university and get your degree that's fine, but it is not mandatory when you are looking for a job as a software developer.
If you still thinking that it is not worth the effort to trying to re-orientate or continue your career as a software developer or related field in the USA, I encourage you to do a quick search on salaries on the internet, this might not be 100% accurate but at least will give you an idea of how much you could worth, you can check this site for salary research:

http://www.indeed.com/salary/Estimator.html
https://www.glassdoor.com/Salaries/index.htm
https://www.roberthalf.com/workplace-research/salary-guides

These are few from the many websites in internet that might help you to investigate what is an average salary for a Software developer or related field.

 

Your English is a must:

learn English

You might be wondering why this guide is written in english, it is because even though the target audience of this material are immigrants, the first step to a successful career in this country is to learn english, if it is not your first language of course.
If you were born in USA, or any English speaking country, or have an excellent domain of the English language, then, you can skip this section. If not this is very important for you, first thing you should do, before you even think of apply for a job, is perfectionate your english or start learning it if you are in cero. Not only because you most likely will be interacting with others at your company in english, but also because a great number of good resources to learn and also the tools you might be interacting with, are going to be in english.

Here are some resources you can use to learn or perfectionate your english:
You can go to college to take ESOL (English for Speakers of Other Languages) class.
If you are starting learning and you want to learn by yourself I recommend you Rosetta Stone
If you are more advanced, then I highly recommend Open English (www.openenglish.com)
www.engvid.com (free and muy bueno)

 

Productivity and inspiration

Productiviti And Inspiration

Productivity: If you are starting you career as a software developer or related field here in the USA or are planning to continue your career here, whichever is your case, you need to be productive and get the most of the time you have available. I don’t know why but I found out that living in this country it is like going hight speed on the expressway, and the time just flies. Being productive means that you are highly effective in a relatively short period of time. One of the most important things in this career is to be prepared and possess as much knowledge as possible in your field, remember, you’ll probably have to compete with very talented people for job opportunities. I strongly believe that the main thing you need to do to improve your productivity is define your goals and plan your actions to achieve those goals.
One technique I use to be focus and improve my performance when I studying or developing software is the pomodoro technique, click here to learn more. In general you can visit this blog post with advices of how to be productive, however this post is more focused to loud open spaces offices, but I guess you’ll extract the idea.
Also if you use chrome you can install this extension to pomodoro your time:
https://chrome.google.com/webstore/detail/pomodoro-timer/hfgjlgjnpkpmnpojkkpfkogapiclopop?utm_source=chrome-app-launcher-info-dialog

Inspiration: sometimes you’ll feel like you don’t want to do anything, that’s normal. It is very important for your productivity to overcome that stage. Look for things that inspires me, had helped me to keep focus and get back on track, for example I found very interesting the Ted Talks, these are some of my favorites:






Inspiration from books:

I consider books a key source of knowledge, as a matter of fact I think it is the main source of knowledge. For me I prefer to listen an audio book (of course, when it is not code examples involved, etc.), I use to drive almost one hour to work, I like to drive while listen an audiobook, also at the gym, when I’m working out. For me it is a bit hard to allocate time to read a paperback book. Also audible offers a monthly subscription of $14.95 a month. Receive 1 credit each month, with that credit you can purchase any audiobook you want (I have this subscription myself).

Click here to subscribe to Audible
These are some of my favorites audiobooks for inspiration:


 

Learn, learn and learn

learn Learn Learn

This is perhaps the most important thing a software developer needs to do to start/maintain and built a successful career. These are some resources to free to learn or sharpen your development skills:
https://www.codecademy.com/
https://www.hackerrank.com/
https://mva.microsoft.com/
https://www.coursera.org/

Some paid services to learn:
https://www.pluralsight.com/
https://www.lynda.com/
https://teamtreehouse.com/
https://www.udemy.com/

Certifications:
There are many opinions on certifications, some managers would like candidates with certification some don’t, In my opinion, possessing a certification doesn’t guarantee that you are going to obtain the job, however it might make the difference between two candidates with the same experience and skill sets, I see certifications as milestones for when I want to learn something new or improve my knowledges in certain technology, When I studying for a certification I like to study to learn deeply first and after that I start thinking on the exam, just my opinion. I totally recommend and encourage you to do certifications, it is a way to study for an end objective (the exam) it is always good to have a little bit of pressure and a deadline, to avoid procrastination.

These are some of the certification, you should research in your field for the certification that suit you:

Scrum:
https://www.scrumalliance.org/certifications/practitioners/certified-scrummaster-csm

Microsoft technologies (Web, Mobile, Desktop, DB, Application lifecycle, etc):
https://www.microsoft.com/en-us/learning/certification-overview.aspx

Java:
http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=458&get_params=p_track_id:JSE7PROG

PHP
http://www.zend.com/en/services/certification

Books:

These are some of my favorites books (click on the images below):

Here click the link to obtain a complete list of
Microsoft Exam references

Some of my favorites technical books (some of them are free):

Javascript:
https://github.com/getify/You-Dont-Know-JS
http://speakingjs.com/es5/index.html

AngularJs:
https://www.ng-book.com/

Asp.Net

C#

I highly encourage you to do some research and find the best books in your field of expertise, you might be surprised of the many books offered for free. For more books, please contact me via tweeter @joMendezdev

Notes:
There are few programs that you might be eligible for, for example the WIOA program (Workforce Innovation and Opportunity Act) Where they can pay for your trainings and courses for your development
http://sitefinity.floridajobs.org/frequently-asked-questions-directory/wia-program-faq
Read the FAQs to get more information.

 

Follow the leaders, learn from them

Follow the Leader

The leaders can help you to stay on top of relevant news and trends and keep up to date in technology. Here is a list of the most relevant Front-End leaders. https://twitter.com/frontendrescue/lists/cool-people/members
Note: I encourage you to find the leaders on your field, follow them, learn from them, and with hard work you can become a leader.


 

Find the best resources (keep current)

find the best resources

In this career it is always important to be current, and be on top of the new frameworks, design patterns, good practices, etc. You should find you own resources in your field, for example daily news, magazines, blog post, etc.
One thing I do is that I subscribe to RSS feeds of the blogs that I’m interested on, here is an example of how you can do it on Outlook (animated gif):

add rss outlook guide

Here are few examples of some of the resources I use to keep current, in my case I look for resources related to .Nec/C#/Javascript/AngularJs etc.:
https://hackernoon.com/
https://medium.com/tag/javascript
http://blog.cwa.me.uk/
https://css-tricks.com/
https://www.smashingmagazine.com/

You’ll need to research and find your resources in your field.

 

Attend conferences

attend conference

Attending conferences is fun, you can meet other developers, in the meetups usually somebody give a speech about certain topic of interest, You can use meetup.com to find groups related to your interests:
https://www.meetup.com/find/?metaCategory=tech
I’m part of the DotNetMiami group, also, MiamiJs, among others. I hope I see you around in one of this groups one of this days.

Also there are some annual events like:

http://technightattheballpark.com/ which take place around august
The tech night at the ballpark it is more for meetup and networking, a lot of recruiters and companies go there to try to find talented tech prospective, and after that, enjoy the baseball game.

http://www.fladotnet.com/codecamp/ (this is awesome, you can’t miss this one)
Description taken from the website:
What is Code Camp? South Florida Code Camp is a FREE one day GEEK FEST held on Saturday February 18, 2017. This is the 13th year for South Florida Code Camp. The event will have speakers from the local community and beyond. Speakers will be presenting some of the most requested topics like Machine Learning, DotNet Core, Windows 10, Mobile Development, ASP.NET, Javascript, JQuery, Visual Studio 2015, MVC Framework, Sharepoint, SQL Server 2016, Xamarin, cross platform development and Azure. Code Camp is community driven by a group of dedicated volunteers and speakers. Breakfast and lunch is included!

 

How to avoid js files cache script bundle with razor

It happened to me, that I was working on an ASP.NET MVC Razor with AngularJs application, and every time that the team make a change in the AngularJs files and deploy to Production, the users start complaining about unresolved issues in the application. Those issues were because of the browser cache the JavaScript files in the client side. So in this article, I'll try to find an optimal solution to this problem, meaning that the javascript bundle should avoid cache when a new version of the application is deployed to production.
bundle cache

Avoiding browser cache:

We have to consider that one of the most popular techniques to avoid browsers cache with javascript files is to add a variable at the end of the file name, like this: src="/app/app.js?nocache=12365434576".

  <script type="text/javascript" src="/app/app.js?nocache=12365434576"></script>

Now this resolve the issue partially since 12365434576 it's going to be a random number that always going to avoid the cache, and we don't want that, we want to avoid cache only when a new version is deployed, for a better performance. So what we need to do is, instead of set the nocache var to a random number we are going to user the version of the application, like this:


Bundle Code:

We had a code like this to compose the bundle in App_Start/BoundleConfig.cs

 private static void AddAppBundles(BundleCollection bundles)
        {
            var path = "admin";
            var scriptBundle = new ScriptBundle("~/js/app");
            var FullPath = HttpContext.Current.Server.MapPath(string.Format("~/{0}", path));
            if (Directory.Exists(FullPath))
            {
                scriptBundle.Include(
                    // Order matters
                    string.Format("~/{0}/app.module.js", path),
                    string.Format("~/{0}/app.core.module.js", path)
                    )

                    .IncludeDirectory(string.Format("~/{0}", path), "*.module.js", true)
                    .IncludeDirectory(string.Format("~/{0}", path), "*.js", true);
            }
            bundles.Add(scriptBundle);
        }

With the code above we can include all the javascript files found in "path" variable in our _Layout.cshtml page, with this code:

@Scripts.Render("~/js/app")

The code is going to render something like this:

  <script type="text/javascript" src="/app/app.js"></script>
<script type="text/javascript" src="/app/config.js"></script>
<script type="text/javascript" src="/app/dashboard/dashboard.module.js"></script>
<script type="text/javascript" src="/app/layout/layout.module.js"></script>
<script type="text/javascript" src="/app/blocks/apiendpoint.config.js"></script>
<script type="text/javascript" src="/app/blocks/apiendpoint.provider.js"></script>

The question here is how we can render something like this src="/app/app.js?nocache=1.28.16145.10", when we render the bundle in razor.
We are going to use @Scripts.RenderFormat.

Solution:

@{  
    string version = typeof(yourProjectNamespace.WebApiApplication).Assembly.GetName().Version.ToString();
}
    <!--app scripts.-->
    @Scripts.RenderFormat("<script type=\"text/javascript\" src=\"{0}?nocache="+ version +"\"></script>", "~/js/app")

This is an example of the result rendered:

  <script type="text/javascript" src="/app/app.js?nocache=1.28.16145.10"></script>
<script type="text/javascript" src="/app/config.js?nocache=1.28.16145.10"></script>
<script type="text/javascript" src="/app/dashboard/dashboard.module.js?nocache=1.28.16145.10"></script>
<script type="text/javascript" src="/app/layout/layout.module.js?nocache=1.28.16145.10"></script>
<script type="text/javascript" src="/app/blocks/apiendpoint.config.js?nocache=1.28.16145.10"></script>
<script type="text/javascript" src="/app/blocks/apiendpoint.provider.js?nocache=1.28.16145.10"></script>

Hope this was helpful. 🙂

State Management in ASP.Net

In this article I'll try to cover the different techniques session state management in ASP.Net applications. With this we are going to be able to determine the best approach for our solution when we manage the session states in ASP.Net applications.
session state management

These are the session state management options in Asp.net

  • Off
  • StateServer
  • InProc
  • SQLServer
  • Cookies
  • Query String
  • Custom

Fot Off|StateServer|InProc|SQLServer, we will need to specify the session state tag in the web.config. This is a template code:

<sessionState mode="Off|StateServer|InProc|SQLServer"
              cookieless="true|false"
              timeout="number of minutes"
              stateConnectionString="tcpip=server:port"
              sqlConnectionString="sql connection string"
              stateNetworkTimeout="number of seconds"/>

Off Mode

Off mode, which disables session state.


StateServer Session State mode

StateServer Session State mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm. StateServer session runs as a Windows service and would help to minimize database traffic.
Example:

<configuration>
  <system.web>
    <sessionState mode="StateServer"
      stateConnectionString="tcpip=SampleStateServer:42424"
      cookieless="false"
      timeout="20"/>
  </system.web>
</configuration>

InProc Session State

InProc Session State, this mode stores session state with the ASP.NET worker process (in memory on the Web server). It is not valid in a web farm configuration.
Example

<configuration>
   <system.web>
      <sessionState mode="InProc"
                    cookieless="true"
                    timeout="20"/>
      </sessionState>
   </system.web>
</configuration>

SqlServer Session State

SqlServer Session State. stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm. Although, It does support a web farm configuration, you should not use this if you want to minimize database traffic.
Example:

<configuration>
  <system.web>
    <sessionState mode="SQLServer"
      sqlConnectionString="Integrated Security=SSPI;data 
        source=SampleSqlServer;" />
  </system.web>
</configuration>

Cookie State mode

Cookie State mode. Cookies are stored on the client, so the application would not be able to keep the state if they switched to a different device or a different browser. Also the user needs to have the cookies enabled in their browser


Query String

Query String It can be used for passing limited state information across request boundaries, this solution would not be able to keep the state if they switched to a different device. This solution will work even if the user have disabled the cookies in the browser.


Custom mode

Custom mode, which enables you to specify a custom storage provider.
Example:

<configuration>
  <connectionStrings>
    <add name="OdbcSessionServices" 
      connectionString="DSN=SessionState;" />
  </connectionStrings>

  <system.web>
    <sessionState 
      mode="Custom"
      customProvider="OdbcSessionProvider">
      <providers>
        <add name="OdbcSessionProvider"
          type="Samples.AspNet.Session.OdbcSessionStateStore"
          connectionStringName="OdbcSessionServices" 
          writeExceptionsToEventLog="false" />
      </providers>
    </sessionState>
  </system.web>
</configuration>

These are the options we have in Asp.net to manage the session state in an application. Hope this was helpful.

ASP.NET MVC Routers common questions

I'm doing this article as a self remainder of how to declare routers in ASP.NET MVC I will try to answer the most common questions about ASP.NET MVC Routers that I was able to find on internet. Hopefully this might help you as well. Routers

When you create a MVC application with Visual Studio, and you go to the RouteConfig.cs file this is the default code generate by the template:

 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
 routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", 
                                action = "Index", 
                                id = UrlParameter.Optional },
                constraints: new {id = @"\d+"}
            );

Most common questions about routers:

"Why do we use route.IgnoreRoute?"
This will tells the routing engine to ignore any requests that match the provided pattern "{resource}.axd/{*pathInfo}". In this case to ignore any requests to axd resources.

"Why the parameters in {} ?"
The {} indicates that the delimited string is a variable, it can anything. In the ignore route this is used so that any .axd requests are matched.

Why map MapRoute has First parameter "Default"
The first parameter is the route name. This can be used when referring to routes by name. It can be null
E.g.

routes.MapRoute(
  "Default", //Default Route
  "{controller}/{action}/{id}", // URL with parameters
   new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
);

routes.MapRoute(
  "Feedback", // Custom Route name
  "Feedback",
   new { controller = "Home", action = "Feedback" }
);

//Then you can call it like this:
@Html.RouteLink("Feedback");

What is the Second Parameter-"{controller}/{action}/{id}" for?
This is the pattern that is matched. In this case it is setting up the default route which is a url formed by the controller name, action name and an optional id. The url http://yoursite.com/Foo/Bar would call the Bar method on the Foo controller. Changing the url to http://mysite.com/Foo/Bar/1 would pass a parameter with the identifier id and value 1.

What is the third parameter?
The third parameter supplies defaults. In the case of the default route the default controller name is Home and the default action is Index. The outcome of this is that a request to http://yoursite.com would call the Index method on the Home controller. The id part of the route is specified as being optional with UrlParameter.Optional.

What is the fourth parameter?
The fourth parameter is for constraints, you can use regular expressions, in this example in particular this expression "\d+" match strings that are sequences of one or more digits (0-9).

How to create a custom Routers Constraint?
For this example we are going to create a Guid constraing, we have to create a class that inherit from IRouteConstraint and implement it:
routers implement interface
This is the code:

public class GuidConstraint : IRouteConstraint {

public bool Match(HttpContextBase httpContext, Route route, string parameterName, 
                  RouteValueDictionary values, RouteDirection routeDirection)
{
    if (values.ContainsKey(parameterName))
    {
        string stringValue = values[parameterName] as string;
        if (!string.IsNullOrEmpty(stringValue))
        {
            Guid guidValue;
            return Guid.TryParse(stringValue, out guidValue) && (guidValue != Guid.Empty);
        }
    }
    return false;
}}

You can use it in the route like this:

routes.MapRoute("doubleGuid", "{controller}/{action}/{guid1}", 
                 new { controller = "YourController", action = "YourAction" }, 
                 new { guid1 = new GuidConstraint() });

Why we use new?
The new keyword is creating/instanciating an object using the object initializer syntax that was introduced in version 3 of the .Net framework.

Difference between “MapHttpRoute” and “MapRoute”?
ultimately both operate on the same underlying ASP.NET route table, the difference is that MapRoute is used for when the application is hosted in ASP.NET. MapHttpRoute is used for Web Apis for when hosting outside of ASP.NET, Web API wouldn't have to rely on System.Web.
Web API is not sitting on top of MVC, Web Forms, or, for that matter ASP.NET at all. It can be hosted within web context (ASP.NET) but can also be self hosted in a Console app, WPF, etc.

The major advantage of using routing is that it creates a convention for your Urls. If you created a new controller called Account and action methods called Index and Review then the methods would be available at /Account and Account/Review respectively.

Other resources:
http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/creating-a-route-constraint-cs
https://msdn.microsoft.com/en-us/library/cc668201.aspx?f=255&MSPPError=-2147217396

How to create a custom controller factory ASP.Net MVC

I was reading about "Control application behavior by using MVC extensibility points" which is one of the objectives for the 70-486 Microsoft certification, and it was not clear to me, the explanation provided. So I decided to write about it to make clear for me, and I hope this help you as well.

An ASP.NET MVC application contains the following class:

public class HomeController: Controller
{
   public HomeController(Ilogger logger)//notice the parameter in the constructor
   {

   }
}

This throw an error with the DefaultControllerFactory see image below.
Dependency injection controller error

The application won't be able to load the HomeController because it have a parameter. You need to ensure that HomeController can be instantiated by the MVC framework. In order to accomplish this we are going to use dependency injection.

The solution is to create a custom controller factory.

It calls the default constructor of that class. To have the MVC framework create controller class instances for constructors that have parameters, you must use a custom controller factory. To accomplish this, you create a class that implements IControllerFactory and implement its methods. You then call the SetControllerFactory method of the ControllerBuilder class to an instance of your custom controller factory class.

Create the CustomControllerFactory that inherit from IControllerFactory:

 public class CustomControllerFactory : IControllerFactory
    {

        public CustomControllerFactory()
        {
        }


        public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
        {
             ILogger logger = new DefaultLogger();
        var myController = new HomeController(logger);
        return controller;
        }

        public System.Web.SessionState.SessionStateBehavior GetControllerSessionBehavior(System.Web.Routing.RequestContext requestContext, string controllerName)
        {
             return SessionStateBehavior.Default;
        }

        public void ReleaseController(IController controller)
        {
            var disposable = myController as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }

        }
    }

 

book

Book Tip

MCSD Certification Toolkit (Exam 70-483): Programming in C
The MCSD 70-483 exam is the entry-level Microsoft certification exam for C# developers and this must-have resource offers essential coverage of the exam that will test your competency in C# programming.


Amazon

 

You can implement the CreateController() method with a more generic way, using reflection.

public class CustomControllerFactory : IControllerFactory
{
    private readonly string _controllerNamespace;
    public CustomControllerFactory(string controllerNamespace)
    {
        _controllerNamespace = controllerNamespace;
    }
    public IController CreateController(System.Web.Routing.RequestContext requestContext, string controllerName)
    {
        ILogger logger = new DefaultLogger();
        Type controllerType = Type.GetType(string.Concat(_controllerNamespace, ".", controllerName, "Controller"));
        IController controller = Activator.CreateInstance(controllerType, new[] { logger }) as Controller;
        return controller;
    }
} 

Set your factory in Application_Start by using SetControllerFactory method:

 protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ControllerBuilder.Current.SetControllerFactory(typeof(CustomControllerFactory));
        }

This could be one of the objective of the Microsoft certification exam 70-486, more specific for "Develop the user experience", sub-objective "Control application behavior by using MVC extensibility points".
Hope this helped you to understand how to do dependency injection in controllers with MVC.

External references:
http://www.asp.net/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-dependency-injection