Example #1
0
        public ColumnModification(
            [NotNull] StateEntry stateEntry,
            [NotNull] IProperty property,
            [NotNull] IRelationalPropertyExtensions propertyExtensions,
            [NotNull] ParameterNameGenerator parameterNameGenerator,
            bool isRead,
            bool isWrite,
            bool isKey,
            bool isCondition)
        {
            Check.NotNull(stateEntry, "stateEntry");
            Check.NotNull(property, "property");
            Check.NotNull(propertyExtensions, "propertyExtensions");
            Check.NotNull(parameterNameGenerator, "parameterNameGenerator");

            _stateEntry    = stateEntry;
            _property      = property;
            _columnName    = propertyExtensions.Column;
            _parameterName = isWrite
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _originalParameterName = isCondition
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _outputParameterName = isRead
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _isRead      = isRead;
            _isWrite     = isWrite;
            _isKey       = isKey;
            _isCondition = isCondition;
        }
        public ColumnModification(
            [NotNull] InternalEntityEntry entry,
            [NotNull] IProperty property,
            [NotNull] IRelationalPropertyExtensions propertyExtensions,
            [NotNull] ParameterNameGenerator parameterNameGenerator,
            bool isRead,
            bool isWrite,
            bool isKey,
            bool isCondition)
        {
            Check.NotNull(entry, nameof(entry));
            Check.NotNull(property, nameof(property));
            Check.NotNull(propertyExtensions, nameof(propertyExtensions));
            Check.NotNull(parameterNameGenerator, nameof(parameterNameGenerator));

            Entry      = entry;
            Property   = property;
            ColumnName = propertyExtensions.Column;

            _parameterName = isWrite
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _originalParameterName = isCondition
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);
            _outputParameterName = isRead
                ? new LazyRef <string>(parameterNameGenerator.GenerateNext)
                : new LazyRef <string>((string)null);

            IsRead      = isRead;
            IsWrite     = isWrite;
            IsKey       = isKey;
            IsCondition = isCondition;
        }