public void Save(Watch entity) { if (WatchRepository.Any(w => w.PersonId == entity.PersonId && w.WebResourceId == entity.WebResourceId)) { throw this.ValidationException(e => e.PersonId, $"Watch already set for this {typeof(Person).Name.SplitUpperCaseBySpace()} and {typeof(WebResource).Name.SplitUpperCaseBySpace()}."); } WatchRepository.Save(entity); }