コード例 #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);
        }