예제 #1
0
 public static SnowFlakGenerator Instance()
 {
     if (snowflake == null)
     {
         snowflake = new SnowFlakGenerator();
     }
     return(snowflake);
 }
예제 #2
0
        public static IIDGenerator Create(GeneratorType type)
        {
            IIDGenerator generator = null;

            switch (type)
            {
            case GeneratorType.GUID:
                generator = new GUIDGenerator();
                break;

            case GeneratorType.SnowFlak:
                generator = new SnowFlakGenerator();
                break;
            }

            return(generator);
        }