diff --git a/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs b/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs index 407179923..bcf034b44 100644 --- a/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs +++ b/backend/FwLite/FwDataMiniLcmBridge/Api/FwDataMiniLcmApi.cs @@ -160,9 +160,9 @@ internal void CompleteExemplars(WritingSystems writingSystems) } } - public Task CreateWritingSystem(WritingSystemType type, WritingSystem writingSystem) + public async Task CreateWritingSystem(WritingSystemType type, WritingSystem writingSystem) { - validators.ValidateAndThrow(writingSystem); + await validators.ValidateAndThrow(writingSystem); var exitingWs = type == WritingSystemType.Analysis ? Cache.ServiceLocator.WritingSystems.AnalysisWritingSystems : Cache.ServiceLocator.WritingSystems.VernacularWritingSystems; if (exitingWs.Any(ws => ws.Id == writingSystem.WsId)) { @@ -195,7 +195,7 @@ public Task CreateWritingSystem(WritingSystemType type, WritingSy WritingSystemType.Vernacular => WritingSystemContainer.CurrentVernacularWritingSystems.Count, _ => throw new ArgumentOutOfRangeException(nameof(type), type, null) } - 1; - return Task.FromResult(FromLcmWritingSystem(ws, index, type)); + return FromLcmWritingSystem(ws, index, type); } public async Task UpdateWritingSystem(WritingSystemId id, WritingSystemType type, UpdateObjectInput update) @@ -221,7 +221,7 @@ await Cache.DoUsingNewOrCurrentUOW("Update WritingSystem", public async Task UpdateWritingSystem(WritingSystem before, WritingSystem after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await Cache.DoUsingNewOrCurrentUOW("Update WritingSystem", "Revert WritingSystem", async () => @@ -248,9 +248,9 @@ public IAsyncEnumerable GetPartsOfSpeech() ? FromLcmPartOfSpeech(partOfSpeech) : null); } - public Task CreatePartOfSpeech(PartOfSpeech partOfSpeech) + public async Task CreatePartOfSpeech(PartOfSpeech partOfSpeech) { - validators.ValidateAndThrow(partOfSpeech); + await validators.ValidateAndThrow(partOfSpeech); IPartOfSpeech? lcmPartOfSpeech = null; if (partOfSpeech.Id == default) partOfSpeech.Id = Guid.NewGuid(); UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW("Create Part of Speech", @@ -262,7 +262,7 @@ public Task CreatePartOfSpeech(PartOfSpeech partOfSpeech) .Create(partOfSpeech.Id, Cache.LangProject.PartsOfSpeechOA); UpdateLcmMultiString(lcmPartOfSpeech.Name, partOfSpeech.Name); }); - return Task.FromResult(FromLcmPartOfSpeech(lcmPartOfSpeech ?? throw new InvalidOperationException("Part of speech was not created"))); + return FromLcmPartOfSpeech(lcmPartOfSpeech ?? throw new InvalidOperationException("Part of speech was not created")); } public Task UpdatePartOfSpeech(Guid id, UpdateObjectInput update) @@ -281,7 +281,7 @@ public Task UpdatePartOfSpeech(Guid id, UpdateObjectInput UpdatePartOfSpeech(PartOfSpeech before, PartOfSpeech after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await PartOfSpeechSync.Sync(before, after, this); return await GetPartOfSpeech(after.Id) ?? throw new NullReferenceException($"unable to find part of speech with id {after.Id}"); } @@ -402,7 +402,7 @@ private ComplexFormType ToComplexFormType(ILexEntryType t) public async Task CreateComplexFormType(ComplexFormType complexFormType) { - await validators.ValidateAndThrowAsync(complexFormType); + await validators.ValidateAndThrow(complexFormType); if (complexFormType.Id == default) complexFormType.Id = Guid.NewGuid(); UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW("Create complex form type", "Remove complex form type", @@ -435,7 +435,7 @@ public Task UpdateComplexFormType(Guid id, UpdateObjectInput UpdateComplexFormType(ComplexFormType before, ComplexFormType after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await ComplexFormTypeSync.Sync(before, after, this); return ToComplexFormType(ComplexFormTypesFlattened.Single(c => c.Guid == after.Id)); } @@ -467,7 +467,7 @@ private PartOfSpeech FromLcmPartOfSpeech(IPartOfSpeech lcmPos) Id = lcmPos.Guid, Name = FromLcmMultiString(lcmPos.Name), // TODO: Abreviation = FromLcmMultiString(partOfSpeech.Abreviation), - Predefined = true, // NOTE: the !string.IsNullOrEmpty(lcmPos.CatalogSourceId) check doesn't work if the PoS originated in CRDT + Predefined = CanonicalGuidsPartOfSpeech.CanonicalPosGuids.Contains(lcmPos.Guid), }; } @@ -667,7 +667,7 @@ public IAsyncEnumerable SearchEntries(string query, QueryOptions? options public async Task CreateEntry(Entry entry) { entry.Id = entry.Id == default ? Guid.NewGuid() : entry.Id; - await validators.ValidateAndThrowAsync(entry); + await validators.ValidateAndThrow(entry); try { UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW("Create Entry", @@ -860,7 +860,7 @@ public Task UpdateEntry(Guid id, UpdateObjectInput update) public async Task UpdateEntry(Entry before, Entry after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await Cache.DoUsingNewOrCurrentUOW("Update Entry", "Revert entry", async () => @@ -966,17 +966,17 @@ private void ApplySenseToLexSense(Sense sense, ILexSense lexSense) return Task.FromResult(lcmSense is null ? null : FromLexSense(lcmSense)); } - public Task CreateSense(Guid entryId, Sense sense, BetweenPosition? between = null) + public async Task CreateSense(Guid entryId, Sense sense, BetweenPosition? between = null) { if (sense.Id == default) sense.Id = Guid.NewGuid(); if (!EntriesRepository.TryGetObject(entryId, out var lexEntry)) throw new InvalidOperationException("Entry not found"); - validators.ValidateAndThrow(sense); + await validators.ValidateAndThrow(sense); UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW("Create Sense", "Remove sense", Cache.ServiceLocator.ActionHandler, () => CreateSense(lexEntry, sense, between)); - return Task.FromResult(FromLexSense(SenseRepository.GetObject(sense.Id))); + return FromLexSense(SenseRepository.GetObject(sense.Id)); } public Task UpdateSense(Guid entryId, Guid senseId, UpdateObjectInput update) @@ -996,7 +996,7 @@ public Task UpdateSense(Guid entryId, Guid senseId, UpdateObjectInput UpdateSense(Guid entryId, Sense before, Sense after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await Cache.DoUsingNewOrCurrentUOW("Update Sense", "Revert Sense", async () => @@ -1078,17 +1078,17 @@ internal void CreateExampleSentence(ILexSense lexSense, ExampleSentence exampleS lexExampleSentence.Reference.get_WritingSystem(0)); } - public Task CreateExampleSentence(Guid entryId, Guid senseId, ExampleSentence exampleSentence) + public async Task CreateExampleSentence(Guid entryId, Guid senseId, ExampleSentence exampleSentence) { if (exampleSentence.Id == default) exampleSentence.Id = Guid.NewGuid(); if (!SenseRepository.TryGetObject(senseId, out var lexSense)) throw new InvalidOperationException("Sense not found"); - validators.ValidateAndThrow(exampleSentence); + await validators.ValidateAndThrow(exampleSentence); UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW("Create Example Sentence", "Remove example sentence", Cache.ServiceLocator.ActionHandler, () => CreateExampleSentence(lexSense, exampleSentence)); - return Task.FromResult(FromLexExampleSentence(senseId, ExampleSentenceRepository.GetObject(exampleSentence.Id))); + return FromLexExampleSentence(senseId, ExampleSentenceRepository.GetObject(exampleSentence.Id)); } public Task UpdateExampleSentence(Guid entryId, @@ -1114,7 +1114,7 @@ public async Task UpdateExampleSentence(Guid entryId, ExampleSentence before, ExampleSentence after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await Cache.DoUsingNewOrCurrentUOW("Update Example Sentence", "Revert Example Sentence", async () => diff --git a/backend/FwLite/FwLiteProjectSync.Tests/Sena3SyncTests.cs b/backend/FwLite/FwLiteProjectSync.Tests/Sena3SyncTests.cs index cbb2eef86..e8100a5b8 100644 --- a/backend/FwLite/FwLiteProjectSync.Tests/Sena3SyncTests.cs +++ b/backend/FwLite/FwLiteProjectSync.Tests/Sena3SyncTests.cs @@ -11,6 +11,7 @@ namespace FwLiteProjectSync.Tests; +[Trait("Category", "Integration")] public class Sena3SyncTests : IClassFixture, IAsyncLifetime { private readonly Sena3Fixture _fixture; @@ -75,7 +76,6 @@ private async Task WorkaroundMissingWritingSystems() } [Fact] - [Trait("Category", "Integration")] public async Task DryRunImport_MakesNoChanges() { await WorkaroundMissingWritingSystems(); @@ -86,7 +86,6 @@ public async Task DryRunImport_MakesNoChanges() } [Fact] - [Trait("Category", "Integration")] public async Task DryRunImport_MakesTheSameChangesAsImport() { var dryRunSyncResult = await _syncService.SyncDryRun(_crdtApi, _fwDataApi); @@ -95,7 +94,6 @@ public async Task DryRunImport_MakesTheSameChangesAsImport() } [Fact] - [Trait("Category", "Integration")] public async Task DryRunSync_MakesNoChanges() { await BypassImport(); @@ -108,7 +106,6 @@ public async Task DryRunSync_MakesNoChanges() [Fact] [Trait("Category", "Slow")] - [Trait("Category", "Integration")] public async Task DryRunSync_MakesTheSameChangesAsSync() { //syncing requires querying entries, which fails if there are no writing systems, so we import those first @@ -123,7 +120,6 @@ public async Task DryRunSync_MakesTheSameChangesAsSync() } [Fact] - [Trait("Category", "Integration")] public async Task FirstSena3SyncJustDoesAnSync() { _fwDataApi.EntryCount.Should().BeGreaterThan(1000, @@ -141,7 +137,6 @@ public async Task FirstSena3SyncJustDoesAnSync() [Fact] [Trait("Category", "Slow")] - [Trait("Category", "Integration")] public async Task SyncWithoutImport_CrdtShouldMatchFwdata() { await BypassImport(); @@ -157,7 +152,6 @@ public async Task SyncWithoutImport_CrdtShouldMatchFwdata() } [Fact] - [Trait("Category", "Integration")] public async Task SecondSena3SyncDoesNothing() { await _syncService.Sync(_crdtApi, _fwDataApi); diff --git a/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs b/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs index 3b84e3dd0..49b293405 100644 --- a/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs +++ b/backend/FwLite/LcmCrdt/CrdtMiniLcmApi.cs @@ -45,7 +45,7 @@ public async Task GetWritingSystems() public async Task CreateWritingSystem(WritingSystemType type, WritingSystem writingSystem) { - await validators.ValidateAndThrowAsync(writingSystem); + await validators.ValidateAndThrow(writingSystem); var entityId = Guid.NewGuid(); var wsCount = await WritingSystems.CountAsync(ws => ws.Type == type); try @@ -70,7 +70,7 @@ public async Task UpdateWritingSystem(WritingSystemId id, Writing public async Task UpdateWritingSystem(WritingSystem before, WritingSystem after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await WritingSystemSync.Sync(before, after, this); return await GetWritingSystem(after.WsId, after.Type) ?? throw new NullReferenceException("unable to find writing system with id " + after.WsId); } @@ -103,7 +103,7 @@ public IAsyncEnumerable GetPartsOfSpeech() public async Task CreatePartOfSpeech(PartOfSpeech partOfSpeech) { - await validators.ValidateAndThrowAsync(partOfSpeech); + await validators.ValidateAndThrow(partOfSpeech); await dataModel.AddChange(ClientId, new CreatePartOfSpeechChange(partOfSpeech.Id, partOfSpeech.Name, partOfSpeech.Predefined)); return await GetPartOfSpeech(partOfSpeech.Id) ?? throw new NullReferenceException(); } @@ -119,7 +119,7 @@ public async Task UpdatePartOfSpeech(Guid id, UpdateObjectInput UpdatePartOfSpeech(PartOfSpeech before, PartOfSpeech after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await PartOfSpeechSync.Sync(before, after, this); return await GetPartOfSpeech(after.Id) ?? throw new NullReferenceException($"unable to find part of speech with id {after.Id}"); } @@ -184,7 +184,7 @@ public IAsyncEnumerable GetComplexFormTypes() public async Task CreateComplexFormType(ComplexFormType complexFormType) { - await validators.ValidateAndThrowAsync(complexFormType); + await validators.ValidateAndThrow(complexFormType); if (complexFormType.Id == default) complexFormType.Id = Guid.NewGuid(); await dataModel.AddChange(ClientId, new CreateComplexFormType(complexFormType.Id, complexFormType.Name)); return await ComplexFormTypes.SingleAsync(c => c.Id == complexFormType.Id); @@ -198,7 +198,7 @@ public async Task UpdateComplexFormType(Guid id, UpdateObjectIn public async Task UpdateComplexFormType(ComplexFormType before, ComplexFormType after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await ComplexFormTypeSync.Sync(before, after, this); return await GetComplexFormType(after.Id) ?? throw new NullReferenceException($"unable to find complex form type with id {after.Id}"); } @@ -368,7 +368,7 @@ private IEnumerable CreateEntryChanges(Entry entry, Dictionary CreateEntry(Entry entry) { - await validators.ValidateAndThrowAsync(entry); + await validators.ValidateAndThrow(entry); await dataModel.AddChanges(ClientId, [ new CreateEntryChange(entry), @@ -456,7 +456,7 @@ public async Task UpdateEntry(Guid id, public async Task UpdateEntry(Entry before, Entry after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await EntrySync.Sync(before, after, this); return await GetEntry(after.Id) ?? throw new NullReferenceException("unable to find entry with id " + after.Id); } @@ -502,7 +502,7 @@ public async Task CreateSense(Guid entryId, Sense sense, BetweenPosition? throw new InvalidOperationException("Order should not be provided when creating a sense"); sense.Order = await OrderPicker.PickOrder(Senses.Where(s => s.EntryId == entryId), between); - await validators.ValidateAndThrowAsync(sense); + await validators.ValidateAndThrow(sense); await dataModel.AddChanges(ClientId, await CreateSenseChanges(entryId, sense).ToArrayAsync()); return await dataModel.GetLatest(sense.Id) ?? throw new NullReferenceException(); } @@ -519,7 +519,7 @@ public async Task UpdateSense(Guid entryId, public async Task UpdateSense(Guid entryId, Sense before, Sense after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await SenseSync.Sync(entryId, before, after, this); return await GetSense(entryId, after.Id) ?? throw new NullReferenceException("unable to find sense with id " + after.Id); } @@ -549,7 +549,7 @@ public async Task CreateExampleSentence(Guid entryId, Guid senseId, ExampleSentence exampleSentence) { - await validators.ValidateAndThrowAsync(exampleSentence); + await validators.ValidateAndThrow(exampleSentence); await dataModel.AddChange(ClientId, new CreateExampleSentenceChange(exampleSentence, senseId)); return await dataModel.GetLatest(exampleSentence.Id) ?? throw new NullReferenceException(); } @@ -578,7 +578,7 @@ public async Task UpdateExampleSentence(Guid entryId, ExampleSentence before, ExampleSentence after) { - await validators.ValidateAndThrowAsync(after); + await validators.ValidateAndThrow(after); await ExampleSentenceSync.Sync(entryId, senseId, before, after, this); return await GetExampleSentence(entryId, senseId, after.Id) ?? throw new NullReferenceException(); } diff --git a/backend/FwLite/MiniLcm.Tests/Validators/EntryValidatorTests.cs b/backend/FwLite/MiniLcm.Tests/Validators/EntryValidatorTests.cs index 034c3a9f2..46c34ff27 100644 --- a/backend/FwLite/MiniLcm.Tests/Validators/EntryValidatorTests.cs +++ b/backend/FwLite/MiniLcm.Tests/Validators/EntryValidatorTests.cs @@ -108,7 +108,6 @@ public void Fails_WhenComplexFormsContainCircularReference() var entryId = Guid.NewGuid(); var entry = new Entry() { Id = entryId, LexemeForm = new MultiString(){{"en", "lexeme"}}, ComplexForms = [new ComplexFormComponent(){ ComplexFormEntryId = entryId, ComponentEntryId = Guid.Empty }] }; _validator.TestValidate(entry).ShouldHaveValidationErrorFor("ComplexForms[0]"); - // _validator.TestValidate(entry).ShouldNotHaveAnyValidationErrors(); } [Fact] @@ -117,7 +116,6 @@ public void Fails_WhenComponentsContainCircularReference() var entryId = Guid.NewGuid(); var entry = new Entry() { Id = entryId, LexemeForm = new MultiString(){{"en", "lexeme"}}, Components = [new ComplexFormComponent(){ ComplexFormEntryId = Guid.Empty, ComponentEntryId = entryId }] }; _validator.TestValidate(entry).ShouldHaveValidationErrorFor("Components[0]"); - // _validator.TestValidate(entry).ShouldNotHaveAnyValidationErrors(); } diff --git a/backend/FwLite/MiniLcm.Tests/Validators/ExampleSentenceValidatorTests.cs b/backend/FwLite/MiniLcm.Tests/Validators/ExampleSentenceValidatorTests.cs index b611276e6..8ce002626 100644 --- a/backend/FwLite/MiniLcm.Tests/Validators/ExampleSentenceValidatorTests.cs +++ b/backend/FwLite/MiniLcm.Tests/Validators/ExampleSentenceValidatorTests.cs @@ -22,8 +22,8 @@ public void Fails_WhenDeletedAtIsNotNull() } [Theory] - [InlineData("Sentence")] - [InlineData("Translation")] + [InlineData(nameof(ExampleSentence.Sentence))] + [InlineData(nameof(ExampleSentence.Translation))] public void Succeeds_WhenNonEmptyFieldIsPresent(string fieldName) { var example = new ExampleSentence() { Id = Guid.NewGuid() }; @@ -32,8 +32,8 @@ public void Succeeds_WhenNonEmptyFieldIsPresent(string fieldName) } [Theory] - [InlineData("Sentence")] - [InlineData("Translation")] + [InlineData(nameof(ExampleSentence.Sentence))] + [InlineData(nameof(ExampleSentence.Translation))] public void Succeeds_WhenNonEmptyFieldHasNoContent(string fieldName) { var example = new ExampleSentence() { Id = Guid.NewGuid() }; @@ -42,8 +42,8 @@ public void Succeeds_WhenNonEmptyFieldHasNoContent(string fieldName) } [Theory] - [InlineData("Sentence")] - [InlineData("Translation")] + [InlineData(nameof(ExampleSentence.Sentence))] + [InlineData(nameof(ExampleSentence.Translation))] public void Fails_WhenNonEmptyFieldHasWsWithEmptyContent(string fieldName) { var example = new ExampleSentence() { Id = Guid.NewGuid() }; diff --git a/backend/FwLite/MiniLcm/Validators/CanonicalGuidsPartOfSpeech.cs b/backend/FwLite/MiniLcm/Validators/CanonicalGuidsPartOfSpeech.cs index f2adee150..22937608a 100644 --- a/backend/FwLite/MiniLcm/Validators/CanonicalGuidsPartOfSpeech.cs +++ b/backend/FwLite/MiniLcm/Validators/CanonicalGuidsPartOfSpeech.cs @@ -1,4 +1,4 @@ -using FluentValidation; +using System.Collections.Frozen; namespace MiniLcm.Validators; @@ -6,7 +6,7 @@ public static class CanonicalGuidsPartOfSpeech { // GUID list taken from src/SIL.LCModel/Templates/GOLDEtic.xml in liblcm // TODO: Consider loading GOLDEtic.xml into app as a resource and add singleton providing access to it, then look up GUIDs there rather than using this hardcoded list - public static HashSet CanonicalPosGuids = [ + public static readonly FrozenSet CanonicalPosGuids = [ new Guid("30d07580-5052-4d91-bc24-469b8b2d7df9"), new Guid("ae115ea8-2cd7-4501-8ae7-dc638e4f17c5"), new Guid("18f1b2b8-0ce3-4889-90e9-003fed6a969f"), diff --git a/backend/FwLite/MiniLcm/Validators/CanonicalGuidsSemanticDomain.cs b/backend/FwLite/MiniLcm/Validators/CanonicalGuidsSemanticDomain.cs index 710b1d6cd..bb4d9a4a4 100644 --- a/backend/FwLite/MiniLcm/Validators/CanonicalGuidsSemanticDomain.cs +++ b/backend/FwLite/MiniLcm/Validators/CanonicalGuidsSemanticDomain.cs @@ -1,4 +1,4 @@ -using FluentValidation; +using System.Collections.Frozen; namespace MiniLcm.Validators; @@ -6,7 +6,8 @@ public static class CanonicalGuidsSemanticDomain { // GUID list taken from src/SIL.LCModel/Templates/SemDom.xml in liblcm // TODO: Consider loading SemDom.xml into app as a resource and add singleton providing access to it, then look up GUIDs there rather than using this hardcoded list - public static HashSet CanonicalSemDomGuids = [ + public static readonly FrozenSet CanonicalSemDomGuids = [ + // TODO: convert to Guid constructor that won't have to parse all these strings. Obviously do something automated to get the result. Then do same for CanonicalGuidsPartOfSpeech because why not. new Guid("63403699-07C1-43F3-A47C-069D6E4316E5"), new Guid("999581C4-1611-4ACB-AE1B-5E6C1DFE6F0C"), new Guid("DC1A2C6F-1B32-4631-8823-36DACC8CB7BB"), diff --git a/backend/FwLite/MiniLcm/Validators/MiniLcmValidators.cs b/backend/FwLite/MiniLcm/Validators/MiniLcmValidators.cs index e08862ade..1ddff866e 100644 --- a/backend/FwLite/MiniLcm/Validators/MiniLcmValidators.cs +++ b/backend/FwLite/MiniLcm/Validators/MiniLcmValidators.cs @@ -13,32 +13,32 @@ public record MiniLcmValidators( IValidator PartOfSpeechValidator, IValidator SemanticDomainValidator) { - public async Task ValidateAndThrowAsync(ComplexFormType value) + public async Task ValidateAndThrow(ComplexFormType value) { await ComplexFormTypeValidator.ValidateAndThrowAsync(value); } - public async Task ValidateAndThrowAsync(Entry value) + public async Task ValidateAndThrow(Entry value) { await EntryValidator.ValidateAndThrowAsync(value); } - public async Task ValidateAndThrowAsync(Sense value) + public async Task ValidateAndThrow(Sense value) { await SenseValidator.ValidateAndThrowAsync(value); } - public async Task ValidateAndThrowAsync(ExampleSentence value) + public async Task ValidateAndThrow(ExampleSentence value) { await ExampleSentenceValidator.ValidateAndThrowAsync(value); } - public async Task ValidateAndThrowAsync(WritingSystem value) + public async Task ValidateAndThrow(WritingSystem value) { await WritingSystemValidator.ValidateAndThrowAsync(value); } - public async Task ValidateAndThrowAsync(PartOfSpeech value) + public async Task ValidateAndThrow(PartOfSpeech value) { await PartOfSpeechValidator.ValidateAndThrowAsync(value); } @@ -47,42 +47,6 @@ public async Task ValidateAndThrowAsync(SemanticDomain value) { await SemanticDomainValidator.ValidateAndThrowAsync(value); } - - public void ValidateAndThrow(ComplexFormType value) - { - ComplexFormTypeValidator.ValidateAndThrow(value); - } - - public void ValidateAndThrow(Entry value) - { - EntryValidator.ValidateAndThrow(value); - } - - public void ValidateAndThrow(Sense value) - { - SenseValidator.ValidateAndThrow(value); - } - - public void ValidateAndThrow(ExampleSentence value) - { - ExampleSentenceValidator.ValidateAndThrow(value); - } - - public void ValidateAndThrow(WritingSystem value) - { - WritingSystemValidator.ValidateAndThrow(value); - } - - public void ValidateAndThrow(PartOfSpeech value) - { - PartOfSpeechValidator.ValidateAndThrow(value); - } - - public void ValidateAndThrow(SemanticDomain value) - { - SemanticDomainValidator.ValidateAndThrow(value); - } - } public static class MiniLcmValidatorsExtensions