Industry Insights from Our Experts

Tag Archives: .NET software development extension

Automapper Review

Comments Off
Filed under .NET, Productivity, Software Architecture

Automapper is a great tool we used in a recent project for mapping objects.  With the tiered architecture we used, we ended up with and MVC front end, and a web service back end.  This meant that there were web service objects and MVC models that had essentially the same structures, but .NET does not implicitely realize this.  What this often causes is code that looks like this:

person.FirstName = Webservice.Person.FirstName;
person.LastName = Webservice.Person.LastName;
person.Birthdate = Webservice.Person.Birthdate;
person.Address = Webservice.Person.Address;
person.PhoneNumber = Webservice.Person.PhoneNumber;
person.Gender = Webservice.Person.Gender;

We’ve all seen this code and to the human eye it looks repetitive, but to a machine it is necessary.  This is where automapper comes in.  It simplifies this process and turns the above code into this:

person = PersonMapper.Map(Webservice.Person);

Having your objects sharing identical field names makes your life a lot easier.  You can install Automapper from NuGet and have it working right away.  Just create a new class and include the automapper library..  Your method signature will look something like this:

public static Models.Person Map(MemberServices.Person person)
   return Mapper.Map(person);

That’s it!  You can call your .Map function from now on and Automapper will handle the rest.


This is of course a very simple example that all Automapper can do for you.  In the case where you do not have identically named fields, you can configure Automapper to map to fields of different names.  You’re also able to map entire arrays if need be to save yourself work on those redundant copy loops.


For more information on AutoMapper and to get started, click here


Windows Communication Foundation Security Must Reads

Comments Off
Filed under .NET, Software Architecture

I’ve been on a bit of a Windows Communication Foundation (WCF) security kick lately. Maybe because of all the Azure and cloud based development we’ve been doing here at Quercus Solutions.

Here are my top reads for all things WCF Security (so far):

  1. Windows Communication Foundation (WCF) Basic Programming Lifecycle : http://msdn.microsoft.com/en-us/library/ms732098
     - Note section titled Parameters and Return Values : Data Contracts
  2. Securing Services and Clients : http://msdn.microsoft.com/en-us/library/ms734736
  3. Message Security in WCF : http://msdn.microsoft.com/en-us/library/ms733137.aspx
  4. How to: Use Transport Security and Message Credentials : http://msdn.microsoft.com/en-us/library/ms789011
  5. Microsoft Patterns and Practices – Improving Web Services Security Guide : http://wcfsecurityguide.codeplex.com/wikipage?title=Ch%2007%20-%20Message%20and%20Transport%20Security%20in%20WCF-
    - Note the Protection Level section for ServiceContract the attributes.
    - Pay attention to the Internet Scenarios section.

Also, another great reference: http://wcfsecurityguide.codeplex.com/






Federated Claims Based Security

Comments Off
Filed under SharePoint, Software Architecture

Systems are becoming more and more interconnected each day. Coordinating all that interconnectivity becomes a challenge, especially in terms of security. A party or client, such as a user, web service, web site, or even another device, may need to collaborate with more than one system. Using a claims-based security approach, a coordinated effort can be made to provide common security information to all systems . Here is how….
Read More »

Save Time and Money with Microsoft Visual Studio LightSwitch 2011

Comments Off
Filed under .NET, LightSwitch

Creating quality line-of-business software applications has never been an easy, nor cheap, proposition for any organization. Larger organizations have the advantage of large budgets and vast resources to mitigate the risks that go along with custom software development projects. Smaller organizations, however, usually can’t afford the time and resources it takes to create the custom software solutions they might need. Building custom software to meet a business need was usually a game that only those in the big leagues could play. Read More »

Copyright 2017 by Quercus Solutions