diff --git a/Postgrest/Attributes/ReferenceAttribute.cs b/Postgrest/Attributes/ReferenceAttribute.cs index 6252290..15b4de1 100644 --- a/Postgrest/Attributes/ReferenceAttribute.cs +++ b/Postgrest/Attributes/ReferenceAttribute.cs @@ -82,15 +82,13 @@ public enum JoinType /// Establishes a reference between two tables /// Model referenced /// Should referenced be included in queries? - /// Should reference data be excluded from inserts/upserts? - /// Should reference data be excluded from updates? /// Specifies the join type for this relationship /// Column this attribute references as specified in Postgres, DOES NOT need to be set if <see cref="ForeignKey"/> is set. /// Foreign Key this attribute references as specified in Postgres (only required if the model references the same table multiple times) /// - public ReferenceAttribute(Type model, JoinType joinType, bool includeInQuery = true, bool ignoreOnInsert = true, - bool ignoreOnUpdate = true, [CallerMemberName] string columnName = "", string? foreignKey = null) - : this(model, includeInQuery, ignoreOnInsert, ignoreOnUpdate, joinType == JoinType.Inner, columnName, + public ReferenceAttribute(Type model, JoinType joinType, bool includeInQuery = true, + [CallerMemberName] string columnName = "", string? foreignKey = null) + : this(model, includeInQuery, joinType == JoinType.Inner, columnName, foreignKey) { } @@ -98,15 +96,12 @@ public ReferenceAttribute(Type model, JoinType joinType, bool includeInQuery = t /// Establishes a reference between two tables /// Model referenced /// Should referenced be included in queries? - /// Should reference data be excluded from inserts/upserts? - /// Should reference data be excluded from updates? /// As to whether the query will filter top-level rows. /// The Property Name on the C# Model /// Column this attribute references as specified in Postgres, DOES NOT need to be set if is set. /// Foreign Key this attribute references as specified in Postgres (only required if the model references the same table multiple times) /// - public ReferenceAttribute(Type model, bool includeInQuery = true, bool ignoreOnInsert = true, - bool ignoreOnUpdate = true, bool useInnerJoin = true, + public ReferenceAttribute(Type model, bool includeInQuery = true, bool useInnerJoin = true, [CallerMemberName] string? columnName = null, string? foreignKey = null) { if (!IsDerivedFromBaseModel(model)) @@ -115,8 +110,8 @@ public ReferenceAttribute(Type model, bool includeInQuery = true, bool ignoreOnI Model = model; IncludeInQuery = includeInQuery; - IgnoreOnInsert = ignoreOnInsert; - IgnoreOnUpdate = ignoreOnUpdate; + IgnoreOnInsert = true; + IgnoreOnUpdate = true; ColumnName = columnName; UseInnerJoin = useInnerJoin; ForeignKey = foreignKey;