public IdentityGenerationStrategyBuilder(TParent parent, Type identityType, Type entity) { this.parent = parent; this.entity = entity; builder = new GeneratorBuilder(mapping, identityType); }
void SetDefaultGenerator() { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, identityType, Layer.UserSupplied); if (identityType == typeof(Guid)) { defaultGenerator.GuidComb(); } else if (identityType == typeof(int) || identityType == typeof(long)) { defaultGenerator.Identity(); } else { defaultGenerator.Assigned(); } attributes.Set("Generator", Layer.Defaults, generatorMapping); }
void SetDefaultGenerator() { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, identityType); if (identityType == typeof(Guid)) { defaultGenerator.GuidComb(); } else if (identityType == typeof(int) || identityType == typeof(long)) { defaultGenerator.Identity(); } else { defaultGenerator.Assigned(); } attributes.SetDefault(x => x.Generator, generatorMapping); }