private Key CreateKey(EntityType entityType, int startingPropertyIndex = -1, int propertyCount = 1) { if (startingPropertyIndex == -1) { startingPropertyIndex = entityType.PropertyCount - 1; } var keyProperties = new Property[propertyCount]; for (var i = 0; i < propertyCount; i++) { var property = entityType.GetOrAddProperty("P" + (startingPropertyIndex + i)); property.ClrType = typeof(int?); property.IsShadowProperty = false; keyProperties[i] = property; keyProperties[i].RequiresValueGenerator = true; } return entityType.AddKey(keyProperties); }
public RelationalPropertyBuilder([NotNull] Property property) { Check.NotNull(property, nameof(property)); _property = property; }
private Key CreateKey(EntityType entityType, int startingPropertyIndex = -1, int propertyCount = 1) { if (startingPropertyIndex == -1) { startingPropertyIndex = entityType.PropertyCount; } var keyProperties = new Property[propertyCount]; for (int i = 0; i < propertyCount; i++) { keyProperties[i] = entityType.GetOrAddProperty("P" + (startingPropertyIndex + i), typeof(int?)); keyProperties[i].GenerateValueOnAdd = true; } return entityType.AddKey(keyProperties); }
private bool RequiresOriginalValue(Property addedOrRemovedProperty) { return(_useEagerSnapshots || ((IProperty)addedOrRemovedProperty).IsConcurrencyToken || ForeignKeys.SelectMany(k => k.Properties).Contains(addedOrRemovedProperty)); }
public SqlServerPropertyBuilder([NotNull] Property property) { Check.NotNull(property, nameof(property)); _property = property; }
public virtual Index FindIndex([NotNull] Property property) { return(FindIndex(new[] { property })); }
public virtual Index GetIndex([NotNull] Property property) { return(GetIndex(new[] { property })); }
public virtual ForeignKey GetForeignKey([NotNull] Property property) { return(GetForeignKey(new[] { property })); }
public virtual ForeignKey GetOrAddForeignKey( [NotNull] Property property, [NotNull] Key principalKey) { return(GetOrAddForeignKey(new[] { property }, principalKey)); }
public virtual Key FindKey([NotNull] Property property) { return(FindKey(new[] { property })); }
public virtual Key GetOrAddKey([NotNull] Property property) { return(GetOrAddKey(new[] { property })); }
public virtual Key GetOrSetPrimaryKey([CanBeNull] Property property) { return(GetOrSetPrimaryKey(property == null ? null : new[] { property })); }