Exemple #1
0
        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);
        }
Exemple #3
0
 /// <summary>
 /// lets the application to assign an identifier to the object before Save() is called.
 /// </summary>
 /// <returns></returns>
 public TParent Assigned()
 {
     builder.Assigned();
     IsDirty = true;
     return(parent);
 }