﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CordSharpCore
{
    public class IdGenerator
    {
        private int _id = 0;
        private object _idLocker = new object();
        public string CreateSerialId()
        {
            lock (_idLocker)
            {
                _id++;
                if (_id == int.MaxValue)
                {
                    _id = 0;
                }
                return _id.ToString();
            }
        }
    }
}
