Example #1
0
        public override InternalPropertyBuilder Apply(InternalPropertyBuilder propertyBuilder, ConcurrencyCheckAttribute attribute, PropertyInfo clrProperty)
        {
            Check.NotNull(propertyBuilder, nameof(propertyBuilder));
            Check.NotNull(attribute, nameof(attribute));

            propertyBuilder.ConcurrencyToken(true, ConfigurationSource.DataAnnotation);

            return(propertyBuilder);
        }
Example #2
0
        public override InternalPropertyBuilder Apply(InternalPropertyBuilder propertyBuilder, TimestampAttribute attribute)
        {
            Check.NotNull(propertyBuilder, nameof(propertyBuilder));
            Check.NotNull(attribute, nameof(attribute));

            if (propertyBuilder.Metadata.ClrType != typeof(byte[]))
            {
                throw new InvalidOperationException(Strings.TimestampAttributeOnNonBinary(propertyBuilder.Metadata.Name));
            }

            propertyBuilder.ValueGenerated(ValueGenerated.OnAddOrUpdate, ConfigurationSource.DataAnnotation);
            propertyBuilder.ConcurrencyToken(true, ConfigurationSource.DataAnnotation);

            return(propertyBuilder);
        }