main
1using System;
2using System.Collections.Generic;
3using gorilla.utility;
4using System.Linq;
5using solidware.financials.service.domain;
6
7namespace solidware.financials.service.orm
8{
9 public class InMemoryDatabase : PersonRepository
10 {
11 HashSet<Person> people = new HashSet<Person>();
12
13 public void save(Person person)
14 {
15 person.id = new Id<Guid>(Guid.NewGuid());
16 people.Add(person);
17 }
18
19 public Person find_by(Guid id)
20 {
21 return people.Single(x => x.id == id);
22 }
23
24 public IEnumerable<Person> find_all()
25 {
26 return people.all();
27 }
28 }
29}