-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from PoweredSoft/feature/ef63-and-efcore3-alpha
Feature/ef63 and efcore3 alpha
- Loading branch information
Showing
19 changed files
with
360 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" /> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> | ||
</startup> | ||
</configuration> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using PoweredSoft.DynamicLinq.Dal.Pocos; | ||
using Microsoft.EntityFrameworkCore; | ||
using JetBrains.Annotations; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace PoweredSoft.DynamicLinq.Dal | ||
{ | ||
public class BlogCoreContext : DbContext | ||
{ | ||
public BlogCoreContext([NotNull] DbContextOptions options) : base(options) | ||
{ | ||
} | ||
|
||
protected BlogCoreContext() | ||
{ | ||
} | ||
|
||
public DbSet<Author> Authors { get; set; } | ||
public DbSet<Comment> Comments { get; set; } | ||
public DbSet<Post> Posts { get; set; } | ||
} | ||
} |
72 changes: 13 additions & 59 deletions
72
PoweredSoft.DynamicLinq.Dal/PoweredSoft.DynamicLinq.Dal.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{C16927E7-1358-4B9D-BDD7-149E505DE6CC}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>PoweredSoft.DynamicLinq.Dal</RootNamespace> | ||
<AssemblyName>PoweredSoft.DynamicLinq.Dal</AssemblyName> | ||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<TargetFrameworks>netstandard2.1</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.ComponentModel.DataAnnotations" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<PackageReference Include="EntityFramework" Version="6.3.0" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="BlogContext.cs" /> | ||
<Compile Include="Configurations\Configurations.cs" /> | ||
<Compile Include="Pocos\Uniqe.cs" /> | ||
<Compile Include="Pocos\Website.cs" /> | ||
<Compile Include="Pocos\CommentLike.cs" /> | ||
<Compile Include="Pocos\Post.cs" /> | ||
<Compile Include="Pocos\Author.cs" /> | ||
<Compile Include="Pocos\Comment.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<ProjectReference Include="..\PoweredSoft.DynamicLinq\PoweredSoft.DynamicLinq.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup /> | ||
|
||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="packages.config" /> | ||
<Folder Include="Properties\" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
PoweredSoft.DynamicLinq.EntityFrameworkCore/Extensions/DbContextExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.EntityFrameworkCore; | ||
using PoweredSoft.DynamicLinq.Fluent; | ||
|
||
namespace PoweredSoft.DynamicLinq.EntityFrameworkCore | ||
{ | ||
public static class DbContextExtensions | ||
{ | ||
private static MethodInfo SetMethod = typeof(DbContext).GetMethod(nameof(DbContext.Set), BindingFlags.Public | BindingFlags.Instance); | ||
|
||
public static IQueryable Query(this DbContext context, Type pocoType, Action<WhereBuilder> callback) | ||
{ | ||
var set = SetMethod.MakeGenericMethod(pocoType).Invoke(context, new object[] { }); | ||
var queryable = set as IQueryable; | ||
var builder = new WhereBuilder(queryable); | ||
callback(builder); | ||
var result = builder.Build(); | ||
return result; | ||
} | ||
|
||
public static IQueryable<T> Query<T>(this DbContext context, Action<WhereBuilder> callback) | ||
where T : class | ||
{ | ||
var query = context.Set<T>().AsQueryable(); | ||
query = query.Query(callback); | ||
return query; | ||
} | ||
|
||
public static IQueryable Where(this DbContext context, Type pocoType, Action<WhereBuilder> callback) | ||
=> context.Query(pocoType, callback); | ||
|
||
public static IQueryable<T> Where<T>(this DbContext context, Action<WhereBuilder> callback) | ||
where T : class => context.Query<T>(callback); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...edSoft.DynamicLinq.EntityFrameworkCore/PoweredSoft.DynamicLinq.EntityFrameworkCore.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild> | ||
<Authors>David Lebee</Authors> | ||
<Company>Powered Software Inc.</Company> | ||
<Product>Entity Framework extensions for Dynamic Linq of PoweredSoft</Product> | ||
<RepositoryType>github</RepositoryType> | ||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicLinq</RepositoryUrl> | ||
<PackageTags>entity framework core efcore ef dynamic linq</PackageTags> | ||
<PackageProjectUrl>https://github.com/PoweredSoft/DynamicLinq</PackageProjectUrl> | ||
<Version>1.1.9</Version> | ||
<AssemblyVersion>1.1.9.0</AssemblyVersion> | ||
<FileVersion>1.1.9.0</FileVersion> | ||
<Description>EF Integration of DynamicLinq</Description> | ||
<PackageId>PoweredSoft.DynamicLinq.EntityFrameworkCore</PackageId> | ||
<PackageReleaseNotes>First Release of efcore extensions</PackageReleaseNotes> | ||
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\PoweredSoft.DynamicLinq\PoweredSoft.DynamicLinq.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration /> |
Oops, something went wrong.