public void Save(Person person)
 {
     if (person == null) throw new ArgumentNullException(nameof(person));
     person.PersonId = Guid.NewGuid();
     _lendingLibraryDbContext.People.Add(person);
     _lendingLibraryDbContext.SaveChanges();
 }
        public void Update(Person existingPerson, Person newPerson)
        {
            if (existingPerson == null) throw new ArgumentNullException(nameof(existingPerson));
            if (newPerson == null) throw new ArgumentNullException(nameof(newPerson));

            existingPerson.FirstName = newPerson.FirstName;
            existingPerson.LastName = newPerson.LastName;
            existingPerson.PhoneNumber = newPerson.PhoneNumber;
            existingPerson.CreatedUsername = newPerson.CreatedUsername;
            existingPerson.DateCreated = newPerson.DateCreated;
            existingPerson.DateLastModified = newPerson.DateLastModified;
            existingPerson.LastModifiedUsername = newPerson.LastModifiedUsername;

            _lendingLibraryDbContext.SaveChanges();
        }
 public void DeletePerson(Person person)
 {
     if (person == null) throw new ArgumentNullException(nameof(person));
     _lendingLibraryDbContext.People.Remove(person);
     _lendingLibraryDbContext.SaveChanges();
 }
 public void Save(Person entity)
 {
     _dbContext.Upsert(entity);
     _dbContext.SaveChanges();
 }