本文整理汇总了C#中IRepository.AllInstances方法的典型用法代码示例。如果您正苦于以下问题:C# IRepository.AllInstances方法的具体用法?C# IRepository.AllInstances怎么用?C# IRepository.AllInstances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRepository
的用法示例。
在下文中一共展示了IRepository.AllInstances方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExportSenses
private static XElement ExportSenses(IRepository<ILexSense> senseRepos, Icu.UNormalizationMode mode)
{
return new XElement("Senses",
from sense in senseRepos.AllInstances()
select new XElement("LexSense",
new XAttribute("Id", sense.Hvo),
CreateAttribute("Msa", sense.MorphoSyntaxAnalysisRA),
ExportBestAnalysis(sense.Gloss, "Gloss", mode),
ExportBestAnalysis(sense.Definition, "Definition", mode)));
}
示例2: ExportEntries
private static XElement ExportEntries(IRepository<ILexEntry> entryRepos)
{
return new XElement("Entries",
from entry in entryRepos.AllInstances()
select new XElement("LexEntry",
new XAttribute("Id", entry.Hvo),
new XElement("CitationForm", entry.CitationFormWithAffixType),
from altForm in entry.AlternateFormsOS
select ExportItemAsReference(altForm, entry.AlternateFormsOS.IndexOf(altForm), "AlternateForms"),
new XElement("LexemeForm",
CreateDstAttribute(entry.LexemeFormOA),
// Protect against a null LexemeFormOA. See FWR-3251.
CreateAttribute("MorphType", entry.LexemeFormOA == null ? null : entry.LexemeFormOA.MorphTypeRA)),
from sense in entry.AllSenses
select ExportItemAsReference(sense, "Sense"),
from msa in entry.MorphoSyntaxAnalysesOC
select ExportItemAsReference(msa, "MorphoSyntaxAnalysis"),
from lexEntryRef in entry.VariantEntryRefs
select new XElement("LexEntryRef",
from componentLexemes in lexEntryRef.ComponentLexemesRS
select ExportItemAsReference(componentLexemes, "ComponentLexeme"),
from lexEntryType in lexEntryRef.VariantEntryTypesRS
select ExportItemAsReference(lexEntryType, "LexEntryType"))));
}
示例3: ExportMorphTypes
private static XElement ExportMorphTypes(IRepository<IMoMorphType> morphTypeRepository, Icu.UNormalizationMode mode)
{
return new XElement("MoMorphTypes",
from morphType in morphTypeRepository.AllInstances()
select new XElement("MoMorphType",
new XAttribute("Id", morphType.Hvo),
new XAttribute("Guid", morphType.Guid.ToString()),
ExportBestAnalysis(morphType.Name, "Name", mode),
ExportBestAnalysis(morphType.Abbreviation, "Abbreviation", mode),
ExportBestAnalysis(morphType.Description, "Description", mode),
new XElement("NumberOfLexEntries", morphType.NumberOfLexEntries)));
}
示例4: ExportLexEntryInflTypes
private static XElement ExportLexEntryInflTypes(IRepository<ILexEntryInflType> irregularlyInflectedFormTypeRepository, Icu.UNormalizationMode mode)
{
return new XElement("LexEntryInflTypes",
from irregularlyInflectedForm in irregularlyInflectedFormTypeRepository.AllInstances()
select new XElement("LexEntryInflType",
new XAttribute("Id", irregularlyInflectedForm.Hvo),
new XAttribute("Guid", irregularlyInflectedForm.Guid.ToString()),
ExportBestAnalysis(irregularlyInflectedForm.Name, "Name", mode),
ExportBestAnalysis(irregularlyInflectedForm.Abbreviation, "Abbreviation",
mode),
ExportBestAnalysis(irregularlyInflectedForm.Description, "Description", mode),
ExportBestAnalysis(irregularlyInflectedForm.GlossPrepend, "GlossPrepend", mode),
ExportBestAnalysis(irregularlyInflectedForm.GlossAppend, "GlossAppend", mode),
from slot in irregularlyInflectedForm.SlotsRC
select ExportItemAsReference(slot, "Slots"),
new XElement("InflectionFeatures",
ExportFeatureStructure(irregularlyInflectedForm.InflFeatsOA))));
}
示例5: ExportCompoundRules
private static XElement ExportCompoundRules(IRepository<IMoEndoCompound> endoCmpRepository, IRepository<IMoExoCompound> exoCmpRepository,
Icu.UNormalizationMode mode)
{
return new XElement("CompoundRules",
from endoCompound in endoCmpRepository.AllInstances()
where !endoCompound.Disabled
select new XElement("MoEndoCompound",
new XAttribute("Id", endoCompound.Hvo),
new XAttribute("HeadLast", endoCompound.HeadLast ? 1 : 0),
ExportBestAnalysis(endoCompound.Name, "Name", mode),
ExportBestAnalysis(endoCompound.Description, "Description", mode),
ExportItemAsReference(endoCompound.LeftMsaOA, "LeftMsa"),
ExportItemAsReference(endoCompound.RightMsaOA, "RightMsa"),
from prod in endoCompound.ToProdRestrictRC
select ExportItemAsReference(prod, "ToProdRestrict"),
ExportItemAsReference(endoCompound.OverridingMsaOA, "OverridingMsa")),
from exoCompound in exoCmpRepository.AllInstances()
where !exoCompound.Disabled
select new XElement("MoExoCompound",
new XAttribute("Id", exoCompound.Hvo),
ExportBestAnalysis(exoCompound.Name, "Name", mode),
ExportBestAnalysis(exoCompound.Description, "Description", mode),
ExportItemAsReference(exoCompound.LeftMsaOA, "LeftMsa"),
ExportItemAsReference(exoCompound.RightMsaOA, "RightMsa"),
from prod in exoCompound.ToProdRestrictRC
select ExportItemAsReference(prod, "ToProdRestrict"),
ExportItemAsReference(exoCompound.ToMsaOA, "ToMsa")));
}