Mercurial > silverbladetech
comparison SilverlightExampleApp/SilverlightExampleApp.Web/Factories/CountryFactory.cs @ 49:502f5f365649
Initial load for Silverlight Example Application
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Tue, 17 Apr 2012 17:57:52 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
48:d617b54e1f47 | 49:502f5f365649 |
---|---|
1 | |
2 using System.Collections.Generic; | |
3 using System.Linq; | |
4 using SilverlightExampleApp.Interfaces.Models; | |
5 using SilverlightExampleApp.Web.Models; | |
6 | |
7 namespace SilverlightExampleApp.Web.Factories | |
8 { | |
9 public class CountryFactory | |
10 { | |
11 private readonly static IList<ICountry> _countries = new List<ICountry>(7) | |
12 { | |
13 new Country() {Id = 1, Description = "England"}, | |
14 new Country() {Id = 2, Description = "France"}, | |
15 new Country() {Id = 3, Description = "Germany"}, | |
16 new Country() {Id = 4, Description = "Italy"}, | |
17 new Country() {Id = 5, Description = "Scotland"}, | |
18 new Country() {Id = 6, Description = "Spain"}, | |
19 new Country() {Id = 7, Description = "Wales"} | |
20 }; | |
21 | |
22 public static IList<ICountry> GetAll() | |
23 { | |
24 return _countries; | |
25 } | |
26 | |
27 public static ICountry Get(int id) | |
28 { | |
29 return _countries.FirstOrDefault(t => id == t.Id); | |
30 } | |
31 } | |
32 } |