Mercurial > silverbladetech
annotate Library/LibrarySystem/Core/Book.cs @ 100:9b6855dc165e
Updated System.Windows into Libs
author | stevenhollidge <stevenhollidge@hotmail.com> |
---|---|
date | Sat, 05 May 2012 23:04:16 +0100 |
parents | aef06698d9e2 |
children |
rev | line source |
---|---|
43
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
1 using System; |
41 | 2 using LibrarySystem.Interfaces; |
3 | |
4 namespace LibrarySystem.Core | |
5 { | |
6 public class Book : IBook | |
7 { | |
8 public string Author { get; set; } | |
9 public string ISBN { get; set; } | |
10 public IPublisher Publisher { get; set; } | |
11 public string Title { get; set; } | |
12 public string Id { get; set; } | |
13 | |
43
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
14 private Book() |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
15 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
16 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
17 } |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
18 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
19 public static IBook Create(string id, IPublication publication) |
41 | 20 { |
43
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
21 if (id == null || publication == null) |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
22 throw new ArgumentNullException(); |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
23 |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
24 return new Book() |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
25 { |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
26 Author = publication.Author, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
27 Id = id, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
28 ISBN = publication.ISBN, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
29 Title = publication.Title, |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
30 Publisher = publication.Publisher |
aef06698d9e2
Added the library tests
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
41
diff
changeset
|
31 }; |
41 | 32 } |
33 } | |
34 } |