CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
IdentityManager.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="IdentityManager.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>Used by the root object in a graph to manage</summary>
7//-----------------------------------------------------------------------
8
9namespace Csla.Core
10{
16 public class IdentityManager
17 {
18 private int _nextIdentity;
19
27 public int GetNextIdentity(int current)
28 {
29 if (current >= _nextIdentity)
30 {
31 _nextIdentity = current + 1;
32 return current;
33 }
34 else
35 {
36 return _nextIdentity++;
37 }
38 }
39 }
40}
Used by the root object in a graph to manage the object instance identity values for the graph.
int GetNextIdentity(int current)
Gets and consumes the next available unique identity value for an object instance in the object graph...