comparison SilverlightExampleApp/SilverlightExampleApp.Web/Factories/TitleFactory.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 using System.Collections.Generic;
2 using System.Linq;
3 using SilverlightExampleApp.Interfaces.Models;
4 using SilverlightExampleApp.Web.Models;
5
6 namespace SilverlightExampleApp.Web.Factories
7 {
8 public class TitleFactory
9 {
10 private readonly static IList<ITitle> _titles = new List<ITitle>(7)
11 {
12 new Title() {Id = 1, Description = "Mr"},
13 new Title() {Id = 2, Description = "Miss"},
14 new Title() {Id = 3, Description = "Mrs"},
15 new Title() {Id = 4, Description = "Ms"},
16 new Title() {Id = 5, Description = "Master"},
17 new Title() {Id = 6, Description = "Sir"},
18 new Title() {Id = 7, Description = "Dr"}
19 };
20 public static IList<ITitle> GetAll()
21 {
22 return _titles;
23 }
24
25 public static ITitle Get(int id)
26 {
27 return _titles.FirstOrDefault(t => id == t.Id);
28 }
29 }
30 }