예제 #1
0
        public static InMemoryPerson ToInMemoryPerson(this Person person)
        {
            var inMemoryPerson = new InMemoryPerson
            {
                Id        = person.Id,
                FirstName = person.Name.First,
                LastName  = person.Name.Last
            };

            return(inMemoryPerson);
        }
예제 #2
0
        public Task <Person> CreateNewPerson(Name name, long taxIdentification)
        {
            var inMemoryPerson = new InMemoryPerson
            {
                Id        = Guid.NewGuid(),
                FirstName = name.First,
                LastName  = name.Last
            };

            _peopleCatalog.Add(taxIdentification, inMemoryPerson);
            var person = inMemoryPerson.ToPerson();

            return(Task.FromResult(person));
        }
예제 #3
0
        public static Person ToPerson(this InMemoryPerson inMemoryPerson)
        {
            var person = new Person(inMemoryPerson.Id, new Name(inMemoryPerson.FirstName, inMemoryPerson.LastName));

            return(person);
        }