public static InMemoryPerson ToInMemoryPerson(this Person person) { var inMemoryPerson = new InMemoryPerson { Id = person.Id, FirstName = person.Name.First, LastName = person.Name.Last }; return(inMemoryPerson); }
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)); }
public static Person ToPerson(this InMemoryPerson inMemoryPerson) { var person = new Person(inMemoryPerson.Id, new Name(inMemoryPerson.FirstName, inMemoryPerson.LastName)); return(person); }