コード例 #1
0
        static async Task CompositeFilter()
        {
            var settings = new RepositorySettings(IsolationLevel.ReadUncommitted, TimeSpan.FromSeconds(1));

            using (var ctx = new Context())
            {
                var repository = new Executor.EntityFramework.Repository <int>(ctx, settings);
                var characters = await repository.ListAsync(new CreatedAfter(new DateTime(2019, 1, 1)).Combine(new CreatedBefore(new DateTime(2019, 7, 1))));
            }

            using (var session = new SessionProvider().OpenSession())
            {
                var repository = new Executor.Nhibernate.Repository <int>(session, settings);
                var characters = await repository.ListAsync(new CreatedAfter(new DateTime(2019, 1, 1)).Combine(new CreatedBefore(new DateTime(2019, 7, 1))));
            }
        }
コード例 #2
0
        static async Task Subquery()
        {
            var settings = new RepositorySettings(IsolationLevel.ReadUncommitted, TimeSpan.FromSeconds(1));

            using (var ctx = new Context())
            {
                var repository = new Executor.EntityFramework.Repository <int>(ctx, settings);
                var characters = await repository.ListAsync(new CharactersForUserWithEmailDomain("@inmagna.ca"));
            }

            using (var session = new SessionProvider().OpenSession())
            {
                var repository = new Executor.Nhibernate.Repository <int>(session, settings);
                var characters = await repository.ListAsync(new CharactersForUserWithEmailDomain("@inmagna.ca"));
            }
        }
コード例 #3
0
        static async Task Fetch()
        {
            var settings = new RepositorySettings(IsolationLevel.ReadUncommitted, TimeSpan.FromSeconds(1));

            using (var ctx = new Context())
            {
                var repository = new Executor.EntityFramework.Repository <int>(ctx, settings);
                var users      = await repository.ListAsync(new UserWithRelatedObjects());
            }

            using (var session = new SessionProvider().OpenSession())
            {
                var repository = new Executor.Nhibernate.Repository <int>(session, settings);
                var users      = await repository.ListAsync(new UserWithRelatedObjects());
            }
        }