public void InternalReferenceEntry_Query_throws_if_used_with_Detached_entity()
            {
                var mockInternalEntry = MockHelper.CreateMockInternalEntityEntry(
                    new FakeEntity(), isDetached: true);
                var internalEntry = new InternalReferenceEntry(mockInternalEntry.Object, FakeWithProps.ReferenceMetadata);

                Assert.Equal(
                    Strings.DbPropertyEntry_NotSupportedForDetached("Query", "Reference", "FakeEntity"),
                    Assert.Throws<InvalidOperationException>(() => internalEntry.Query()).Message);
            }
Exemplo n.º 2
0
 /// <summary>
 ///     Returns the query that would be used to load this entity from the database.
 ///     The returned query can be modified using LINQ to perform filtering or operations in the database.
 /// </summary>
 /// <returns> A query for the entity. </returns>
 public IQueryable <TProperty> Query()
 {
     return((IQueryable <TProperty>)_internalReferenceEntry.Query());
 }
 /// <summary>
 ///     Returns the query that would be used to load this entity from the database.
 ///     The returned query can be modified using LINQ to perform filtering or operations in the database.
 /// </summary>
 /// <returns> A query for the entity. </returns>
 public IQueryable Query()
 {
     return(_internalReferenceEntry.Query());
 }