diff --git a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Api/TrippinApi.cs b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Api/TrippinApi.cs index be25efeb..96610c11 100644 --- a/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Api/TrippinApi.cs +++ b/test/ODataEndToEnd/Microsoft.OData.Service.Sample.TrippinInMemory/Api/TrippinApi.cs @@ -48,7 +48,12 @@ public IQueryable People get { var datasource = _dataStoreManager.GetDataStoreInstance(Key); - return datasource?.People.AsQueryable(); + if (datasource != null) + { + return datasource.People.AsQueryable(); + } + + return null; } } @@ -57,7 +62,12 @@ public IQueryable NewComePeople get { var datasource = _dataStoreManager.GetDataStoreInstance(Key); - return datasource?.People.AsQueryable(); + if (datasource != null) + { + return datasource.People.AsQueryable(); + } + + return null; } } @@ -66,7 +76,12 @@ public Person Me get { var datasource = _dataStoreManager.GetDataStoreInstance(Key); - return datasource?.Me; + if (datasource != null) + { + return datasource.Me; + } + + return null; } } @@ -75,7 +90,12 @@ public IQueryable Airlines get { var datasource = _dataStoreManager.GetDataStoreInstance(Key); - return datasource?.Airlines.AsQueryable(); + if (datasource != null) + { + return datasource.Airlines.AsQueryable(); + } + + return null; } } @@ -84,7 +104,12 @@ public IQueryable Airports get { var datasource = _dataStoreManager.GetDataStoreInstance(Key); - return datasource?.Airports.AsQueryable(); + if (datasource != null) + { + return datasource.Airports.AsQueryable(); + } + + return null; } } @@ -349,7 +374,7 @@ public Task ExecuteSubmitAsync(SubmitContext context, Cancellation /// private class CustomerizedChangeSetInitializer : IChangeSetInitializer { - public async Task InitializeAsync(SubmitContext context, CancellationToken cancellationToken) + public Task InitializeAsync(SubmitContext context, CancellationToken cancellationToken) { var key = LibraryUtils.GetSessionId(); var dataSource = _dataStoreManager.GetDataStoreInstance(key); @@ -417,6 +442,8 @@ public async Task InitializeAsync(SubmitContext context, CancellationToken cance } } } + + return Task.WhenAll(); } private static void SetValues(object instance, Type type, IReadOnlyDictionary values)