diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SilverlightExampleApp/SilverlightExampleApp.Web/Factories/TitleFactory.cs	Tue Apr 17 17:57:52 2012 +0100
@@ -0,0 +1,30 @@
+using System.Collections.Generic;
+using System.Linq;
+using SilverlightExampleApp.Interfaces.Models;
+using SilverlightExampleApp.Web.Models;
+
+namespace SilverlightExampleApp.Web.Factories
+{
+    public class TitleFactory
+    {
+        private readonly static IList<ITitle> _titles = new List<ITitle>(7)
+                                        {
+                                            new Title() {Id = 1, Description = "Mr"},
+                                            new Title() {Id = 2, Description = "Miss"},
+                                            new Title() {Id = 3, Description = "Mrs"},
+                                            new Title() {Id = 4, Description = "Ms"},
+                                            new Title() {Id = 5, Description = "Master"},
+                                            new Title() {Id = 6, Description = "Sir"},
+                                            new Title() {Id = 7, Description = "Dr"}
+                                        };
+        public static IList<ITitle> GetAll()
+        {
+            return _titles;
+        }
+
+        public static ITitle Get(int id)
+        {
+            return _titles.FirstOrDefault(t => id == t.Id);
+        }
+    }
+}
\ No newline at end of file