Exemplo n.º 1
0
        public static ForeignKey FindForeignKey(
            [NotNull] this EntityType entityType,
            [NotNull] EntityType principalType,
            [CanBeNull] string navigationToPrincipal,
            [CanBeNull] string navigationToDependent,
            [CanBeNull] IReadOnlyList <Property> foreignKeyProperties,
            [CanBeNull] IReadOnlyList <Property> principalProperties,
            bool?isUnique)
        {
            Check.NotNull(principalType, nameof(principalType));

            return(entityType.GetForeignKeys().FirstOrDefault(fk =>
                                                              fk.IsCompatible(
                                                                  principalType,
                                                                  entityType,
                                                                  navigationToPrincipal,
                                                                  navigationToDependent,
                                                                  foreignKeyProperties,
                                                                  principalProperties,
                                                                  isUnique)));
        }