ReindexResult Class
Assembly: CodeEffects.Rule.Repository.dll
Namespace: CodeEffects.Rule.Repository
Summary
Describes what Context.Reindex(..) did: one ReindexSourceResult for each source object it processed.
Syntax
public class ReindexResult
You never create this class. Context.Reindex(..) returns it. Each source object is reindexed in its own transaction. If any of them fails, it is rolled back, the others go on, and the method throws a RepositoryException at the end whose ReindexResult property holds this object.
Properties
Sources
Type: System.Collections.Generic.IList<CodeEffects.Rule.Repository.ReindexSourceResult>
Gets one entry per source object that was reindexed, in the order they were processed: the order in which the aliases were supplied, or the repository's own order when none were.
Success
Type: System.Boolean
Gets a value indicating whether every source object was reindexed.
Example
using System;
using System.Linq;
using CodeEffects.Rule.Repository;
try
{
ReindexResult result = Context.Reindex(dbProvider);
foreach(ReindexSourceResult source in result.Sources)
{
Console.WriteLine(source.AliasName + ": " + source.RuleVersionCount + " rule version(s), " + source.ReferenceCount + " reference(s)");
foreach(string use in source.Unresolved)
Console.WriteLine(" unresolved: " + use);
}
}
catch(RepositoryException ex) when(ex.ReindexResult != null)
{
foreach(ReindexSourceResult failed in ex.ReindexResult.Sources.Where(s => !s.Success))
Console.WriteLine(failed.AliasName + " " + failed.ControlNumber + " " + failed.Message);
}