Esempio n. 1
0
        public async Task UpdatePersonAsync(Person person)
        {
            PersonValidator validator = new PersonValidator();

            validator.ValidateAndThrow(person);

            await this._personRepository.UpdateAsync(person);
        }
Esempio n. 2
0
        public void UpdatePerson(Person person)
        {
            PersonValidator validator = new PersonValidator();

            validator.ValidateAndThrow(person);

            this._personRepository.Update(person);
        }
        private Person CreatePerson(Document inDocument)
        {
            using var documentContext = this.ApiServiceContext.CreateApiDocumentContext(inDocument);
            var inPerson = documentContext.GetResource <Person>();

            var validator = new PersonValidator();

            validator.ValidateAndThrow(inPerson);

            var outPerson = this.BloggingRepository.CreatePerson(inPerson);

            return(outPerson);
        }