예제 #1
0
        public virtual async Task Execute <T, TResult>(QueryParametersScalar <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <TResult>(parameters.RequestUri, false, 0).ConfigureAwait(false);

            IList fromDb;

            using (var dataContext = (DbContext)DbDataAdapter.CreateDataContext())
                fromDb = TestHelper.ExecuteDb(DbDataAdapter.EntitySetAdapters, dataContext, parameters.Expression);

            Console.WriteLine(parameters.RequestUri);
            TestHelper.Compare(fromDb, fromOe, null);
        }
예제 #2
0
        public virtual async Task Execute <T, TResult>(QueryParameters <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <TResult>(parameters.RequestUri, parameters.NavigationNextLink, parameters.PageSize).ConfigureAwait(false);

            IList fromDb;
            IReadOnlyList <IncludeVisitor.Include> includes;

            using (var dataContext = (DbContext)DbDataAdapter.CreateDataContext())
                fromDb = TestHelper.ExecuteDb(DbDataAdapter.EntitySetAdapters, dataContext, parameters.Expression, out includes);

            Console.WriteLine(parameters.RequestUri);
            TestHelper.Compare(fromDb, fromOe, includes);
        }
예제 #3
0
        public virtual async Task Execute <T, TResult>(QueryParameters <T, TResult> parameters)
        {
            IList fromOe = await ExecuteOe <TResult>(parameters.RequestUri, typeof(T));

            IList fromDb;

            using (var dataContext = (DbContext)DbDataAdapter.CreateDataContext())
                fromDb = TestHelper.ExecuteDb(dataContext, parameters.Expression);

            var settings = new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                NullValueHandling     = NullValueHandling.Ignore
            };
            String jsonOe = JsonConvert.SerializeObject(fromOe, settings);
            String jsonDb = JsonConvert.SerializeObject(fromDb, settings);

            Console.WriteLine(parameters.RequestUri);
            Xunit.Assert.Equal(jsonDb, jsonOe);
        }