Skip to content

Commit

Permalink
Fix in GenericODataController to allow $expand
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-matt committed Feb 21, 2022
1 parent 6a80b5f commit b210490
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="6.3.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1" PrivateAssets="all">
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2" PrivateAssets="all">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.2" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Demos/Demo.Data.InfoSchema/Demo.Data.InfoSchema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.3.261602">
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.3.310801">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="6.3.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.5.4" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.5.4" />
<PackageReference Include="EPPlus" Version="5.8.5" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.5.5" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.5.5" />
<PackageReference Include="EPPlus" Version="5.8.6" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Radzen.Blazor" Version="3.14.2" />
<PackageReference Include="Radzen.Blazor" Version="3.15.5" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Extenso.AspNetCore.OData/Extenso.AspNetCore.OData.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<NeutralLanguage>en-US</NeutralLanguage>
<PackageLicenseUrl>https://raw.githubusercontent.com/gordon-matt/Extenso/master/LICENSE.txt</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/gordon-matt/Extenso</PackageProjectUrl>
<Version>6.0.0</Version>
<Version>6.0.1</Version>
<Description></Description>
</PropertyGroup>

Expand All @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 1 addition & 7 deletions Extenso.AspNetCore.OData/GenericODataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,7 @@ public virtual async Task<IActionResult> Get(ODataQueryOptions<TEntity> options)
var query = connection.Query();
query = ApplyMandatoryFilter(query);
var results = options.ApplyTo(query, IgnoreQueryOptions);

// Recommended not to use ToHashSetAsync(). See: https://github.com/OData/WebApi/issues/1235#issuecomment-371322404
//return await (results as IQueryable<TEntity>).ToHashSetAsync();

var response = await Task.FromResult((results as IQueryable<TEntity>).ToHashSet());
//string jsonTest = response.JsonSerialize();
return Ok(response);
return Ok(results);
}

// TODO: Can't do $expand, because entity is not from an IQueryable.. and also we don't have a ODataQueryOptions here..
Expand Down
8 changes: 4 additions & 4 deletions Extenso.Data.Entity/Extenso.Data.Entity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
<PackageProjectUrl>https://github.com/gordon-matt/Extenso</PackageProjectUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<Description>This library provides a generic repository interface and base class, as well as other data-related extension methods and helper classes.</Description>
<Version>6.0.0</Version>
<Version>6.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\Extenso.Data.Entity.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.1" />
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="6.13.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.2" />
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="6.13.10" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Extenso.Data.MySql/Extenso.Data.MySql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<PackageProjectUrl>https://github.com/gordon-matt/Extenso</PackageProjectUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<Description>Data-related extension methods and other helper classes for MySql</Description>
<Version>6.0.0</Version>
<Version>6.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\Extenso.Data.MySql.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MySql.Data" Version="8.0.27" />
<PackageReference Include="MySql.Data" Version="8.0.28" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Extenso.Data.Npgsql/Extenso.Data.Npgsql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<PackageProjectUrl>https://github.com/gordon-matt/Extenso</PackageProjectUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<Description>Data-related extension methods and other helper classes for Npgsql</Description>
<Version>6.0.0</Version>
<Version>6.0.1</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\Extenso.Data.Npgsql.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.2" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit b210490

Please sign in to comment.