Jump to: navigation, search

Changes


Sequence Generator

181 bytes added, 09:43, 14 November 2019
<source lang="csharp">
 
UBIK.Kernel.Utility.SequenceGenerator seqGenerator = new UBIK.Kernel.Utility.SequenceGenerator(this.Environment); //no "number group" is managed as one group itself
if (seqGenerator.TryCreateNewSequentialID(out int seqID))
{
// do something with the given ID: ContentClass myContent; myContent.TrySetValue<int>("SEQUENCE", seqID); myContent.Save();
}
</source>
<source lang="csharp">
 
ContentClass myContent;
UBIK.Kernel.Utility.SequenceGenerator seqGenerator = new UBIK.Kernel.Utility.SequenceGenerator(this.Environment, "GROUP01");
myContent.Save();
}
</source>
// or optional approach'''Example: Create a new ID and set it to an object using the generator <source lang="csharp">
if (seqGenerator.TrySetSequentialID(myContent, "SEQUENCE", out int seqID))
{
1,579
edits