Skip to content

Commit

Permalink
Merge pull request #7 from PoweredSoft/feature/ef63-and-efcore3-alpha
Browse files Browse the repository at this point in the history
Feature/ef63 and efcore3 alpha
  • Loading branch information
dlebee authored Nov 12, 2019
2 parents 3a5ebd9 + 4c28b2c commit bef5d49
Show file tree
Hide file tree
Showing 19 changed files with 360 additions and 256 deletions.
6 changes: 3 additions & 3 deletions PoweredSoft.DynamicLinq.ConsoleApp/App.config
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>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<OutputType>Exe</OutputType>
<RootNamespace>PoweredSoft.DynamicLinq.ConsoleApp</RootNamespace>
<AssemblyName>PoweredSoft.DynamicLinq.ConsoleApp</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -53,10 +54,6 @@
<Project>{c16927e7-1358-4b9d-bdd7-149e505de6cc}</Project>
<Name>PoweredSoft.DynamicLinq.Dal</Name>
</ProjectReference>
<ProjectReference Include="..\PoweredSoft.DynamicLinq.Test\PoweredSoft.DynamicLinq.Test.csproj">
<Project>{6f5c80f0-9045-4098-913f-7bdad135e6dd}</Project>
<Name>PoweredSoft.DynamicLinq.Test</Name>
</ProjectReference>
<ProjectReference Include="..\PoweredSoft.DynamicLinq\PoweredSoft.DynamicLinq.csproj">
<Project>{5bb7e50f-8b40-4512-88dc-4b3bd89c9a5e}</Project>
<Name>PoweredSoft.DynamicLinq</Name>
Expand Down
3 changes: 1 addition & 2 deletions PoweredSoft.DynamicLinq.ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public class SelectExpression
{
static void Main(string[] args)
{
var selectTests = new SelectTests();
selectTests.SelectNullChecking2();

}

}
Expand Down
1 change: 1 addition & 0 deletions PoweredSoft.DynamicLinq.Dal/BlogContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace PoweredSoft.DynamicLinq.Dal
{

public class BlogContext : DbContext
{
public DbSet<Author> Authors { get; set; }
Expand Down
22 changes: 22 additions & 0 deletions PoweredSoft.DynamicLinq.Dal/BlogCoreContext.cs
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 PoweredSoft.DynamicLinq.Dal/PoweredSoft.DynamicLinq.Dal.csproj
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>
36 changes: 0 additions & 36 deletions PoweredSoft.DynamicLinq.Dal/Properties/AssemblyInfo.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.1;net461</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>David Lebee</Authors>
<Company>Powered Software Inc.</Company>
Expand All @@ -10,17 +10,17 @@
<RepositoryUrl>https://github.com/PoweredSoft/DynamicLinq</RepositoryUrl>
<PackageTags>entity framework ef dynamic linq</PackageTags>
<PackageProjectUrl>https://github.com/PoweredSoft/DynamicLinq</PackageProjectUrl>
<Version>1.1.8</Version>
<AssemblyVersion>1.1.8.0</AssemblyVersion>
<FileVersion>1.1.8.0</FileVersion>
<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.EntityFramework</PackageId>
<PackageReleaseNotes>Added Negate &amp; NotContains</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="EntityFramework" Version="6.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions PoweredSoft.DynamicLinq.EntityFramework/packages.config

This file was deleted.

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);
}
}
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>
2 changes: 2 additions & 0 deletions PoweredSoft.DynamicLinq.Test/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration />
Loading

0 comments on commit bef5d49

Please sign in to comment.