Esempio n. 1
0
    public async Task TemporalAll_throws_for_InMemory(bool async)
    {
        using var context = new InMemoryQueryContext();
        var query = context.Blogs.TemporalAll();

        var message = async
            ? (await Assert.ThrowsAsync <InvalidOperationException>(() => query.ToListAsync())).Message
            : Assert.Throws <InvalidOperationException>(() => query.ToList()).Message;

        Assert.Equal(CoreStrings.QueryUnhandledQueryRootExpression(nameof(TemporalAllQueryRootExpression)), message);
    }
Esempio n. 2
0
    public async Task AsSingleQuery_does_not_throw_for_InMemory(bool async)
    {
        using var context = new InMemoryQueryContext();
        var query = context.Blogs.Include(e => e.Posts).AsSingleQuery();

        if (async)
        {
            await query.ToListAsync();
        }
        else
        {
            query.ToList();
        }
    }