/// <summary> /// lets the application to assign an identifier to the object before Save() is called. /// </summary> /// <returns></returns> public void Assigned() { if (!mapping.IsSpecified("Class")) { builder.Assigned(); } }
private GeneratorMapping GetDefaultGenerator(Member property) { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, property.PropertyType); if (property.PropertyType == typeof(Guid)) defaultGenerator.GuidComb(); else if (property.PropertyType == typeof(int) || property.PropertyType == typeof(long)) defaultGenerator.Identity(); else defaultGenerator.Assigned(); return generatorMapping; }
GeneratorMapping GetDefaultGenerator(Member property) { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, property.PropertyType, Layer.Defaults); if (property.PropertyType == typeof(Guid)) defaultGenerator.GuidComb(); else if (identityCompatibleTypes.Contains(property.PropertyType)) defaultGenerator.Identity(); else defaultGenerator.Assigned(); return generatorMapping; }
GeneratorMapping GetDefaultGenerator(Member property) { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, property.PropertyType, Layer.Defaults); if (property.PropertyType == typeof(Guid)) { defaultGenerator.GuidComb(); } else if (identityCompatibleTypes.Contains(property.PropertyType)) { defaultGenerator.Identity(); } else { defaultGenerator.Assigned(); } return(generatorMapping); }
private GeneratorMapping GetDefaultGenerator(Member property) { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, property.PropertyType); if (property.PropertyType == typeof(Guid)) { defaultGenerator.GuidComb(); } else if (property.PropertyType == typeof(int) || property.PropertyType == typeof(long)) { defaultGenerator.Identity(); } else { defaultGenerator.Assigned(); } return(generatorMapping); }
private void SetDefaultGenerator() { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, property.PropertyType); if (property.PropertyType == typeof(Guid)) defaultGenerator.GuidComb(); else if (property.PropertyType == typeof(int) || property.PropertyType == typeof(long)) defaultGenerator.Identity(); else defaultGenerator.Assigned(); attributes.SetDefault(x => x.Generator, generatorMapping); }
private static GeneratorMapping GetDefaultGenerator(Member property) { var generatorMapping = new GeneratorMapping(); var defaultGenerator = new GeneratorBuilder(generatorMapping, property.PropertyType, Layer.Defaults); if (property.PropertyType == typeof (Guid)) { defaultGenerator.GuidComb(); } else if (property.PropertyType == typeof (int) || property.PropertyType == typeof (long)) { defaultGenerator.Identity(); } else { defaultGenerator.Assigned(); } return generatorMapping; }
/// <summary> /// lets the application to assign an identifier to the object before Save() is called. /// </summary> /// <returns></returns> public void Assigned() { builder.Assigned(); }