static IdBuilder() { _dic[typeof(IdBuilder)] = new IdBuilderRule() { prefix = "", FCount = 4, DateFormat = "yyyyMMddHHmmssffff" }; }
public static void Register(Type type, string prefix, int fCount, string timeFormat) { _dic[type] = new IdBuilderRule() { prefix = prefix, FCount = fCount, DateFormat = timeFormat }; }
public static string NextStringId(Type type) { IdBuilderRule rule = null; if (!_dic.ContainsKey(type)) { rule = _dic[typeof(IdBuilder)]; } else { rule = _dic[type]; } //long idTick = rule.Next(); //var now = new DateTime(idTick); return(rule.prefix + ObjectIdGenerator.NextId()); }
public static void Register(Type type, IdBuilderRule rule) { _dic[type] = rule; }