private void UpdateColours(PersonDto personDto, Person person)
 {
     var colours = this.context.Colours.Where(c => personDto.Colours.Contains(c.Id));
     foreach (var colour in colours)
     {
         person.FavouriteColours.Add(colour);
     }
 }
        public bool Update(PersonDto personDto)
        {
            var person = this.context.People.Include("FavouriteColours")
                 .FirstOrDefault(p => p.Id == personDto.Id);

            if (person == null)
            {
                return false;
            }

            person.IsAuthorised = personDto.IsAuthorised;
            person.IsEnabled = personDto.IsEnabled;

            person.FavouriteColours.Clear();
            this.UpdateColours(personDto, person);

            this.context.SaveChanges();
            return true;
        }