// detects whether the S-side Property represents the dependent side of an Association (e.g. for Split Entity or TPT or C-side Conditions) private static bool IsDependentSidePropertyInAssociation(Property storageProperty) { if (storageProperty == null || storageProperty.EntityModel.IsCSDL) { Debug.Fail( "should only receive a storage-side Property. Received property: " + (storageProperty == null ? "NULL" : storageProperty.ToPrettyString())); return true; // returning true will mean this table's SGP settings will not be adjusted } foreach (var propRef in storageProperty.GetAntiDependenciesOfType<PropertyRef>()) { var assoc = propRef.GetParentOfType(typeof(Association)) as Association; if (assoc == null) { // no Association parent - so ignore this PropertyRef continue; } foreach (var prop in assoc.DependentRoleProperties) { if (storageProperty.Equals(prop)) { // found storage property on the dependent side which is part of an association return true; } } } return false; }