Based on this class, Entity Framework will produce incorrect output:
Country Year TotalSales
Philippines 2010 20.000000
Philippines 2010 20.000000

The problem is, that Country alone doesn’t make the row unique. To guarantee uniqueness, the field Year must be included in the primary key, like shown below:
public class SalesOnEachCountry
{
[Key, Column(Order=0)] public int CountryId { get; set; }
public string CountryName { get; set; }
[Key, Column(Order=1)] public int OrYear { get; set; }

Note from practical experience. Changing the code behind file vw_PortalFault.cs in EsbExceptionDbModel.tt to include the [Key] annotation didn’t work for me. Just open the edmx diagram, go to vw_PortalFaults and then set property EntityKey to true for both FaultCode and FaultCode. Next close and re-open Visual Studio. Build the project, deploy the service containing the edmx model and bingo: it works!