예제 #1
0
        public void Initialize(IdContext_I context)
        {
            if (XSettings.GetString(LastIdIssuedKey, out string lastIdIssued) &&
                !string.IsNullOrEmpty(lastIdIssued) &&
                Int64.TryParse(lastIdIssued, out long lastId))
            {
                context.AvailableRange = new AvailableIdRange()
                {
                    LastIssuedId = lastId
                };

                return;
            }

            XSettings.SetAndPersist(LastIdIssuedKey, "0");

            context.AvailableRange = new AvailableIdRange()
            {
                LastIssuedId = 0
            };
        }