Esempio n. 1
0
            static bool IsStrategyNoneNeeded(IReadOnlyProperty property, StoreObjectIdentifier storeObject)
            {
                if (property.ValueGenerated == ValueGenerated.OnAdd &&
                    property.GetDefaultValue(storeObject) == null &&
                    property.GetDefaultValueSql(storeObject) == null &&
                    property.GetComputedColumnSql(storeObject) == null &&
                    property.DeclaringEntityType.Model.GetValueGenerationStrategy() != NpgsqlValueGenerationStrategy.None)
                {
                    var providerClrType = (property.GetValueConverter() ?? property.FindRelationalTypeMapping(storeObject)?.Converter)
                                          ?.ProviderClrType.UnwrapNullableType();

                    return(providerClrType != null && (providerClrType.IsInteger()));
                }

                return(false);
            }
Esempio n. 2
0
 private static ValueConverter GetConverter(IReadOnlyProperty property)
 => property.FindTypeMapping()?.Converter ?? property.GetValueConverter();