private void UpdateFullName(Customer entity) { var shouldUpdate = entity.IsTransientRecord(); if (!shouldUpdate) { shouldUpdate = entity.FullName.IsEmpty() && (entity.FirstName.HasValue() || entity.LastName.HasValue()); } if (!shouldUpdate) { var modProps = _db.GetModifiedProperties(entity); shouldUpdate = _candidateProps.Any(x => modProps.ContainsKey(x)); } if (shouldUpdate) { var parts = new[] { entity.Salutation, entity.Title, entity.FirstName, entity.LastName }; entity.FullName = string.Join(" ", parts.Where(x => x.HasValue())).NullEmpty(); } }