Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change namespace of LinqKit.Microsoft.EntityFrameworkCore #81

Closed
vertonghenb opened this issue Jul 30, 2018 · 3 comments
Closed

Change namespace of LinqKit.Microsoft.EntityFrameworkCore #81

vertonghenb opened this issue Jul 30, 2018 · 3 comments

Comments

@vertonghenb
Copy link

I want to be able to use LinqKit.Core in my domain project and Linqkit.EntityFramework.Core in my data project(since I don't want a dependency on EF Core in my domain). However my data layer has a dependency on the domain project therefore I cannot use LinqKit's functions since the calls are ambigious.

Steps to reproduce:
Reference Linqkit.Core in your domain layer (you don't want a EF dependency here)
and LinqKit.Microsoft.EntityFrameworkCore in the data layer.

Please rename the namespaces of the LinqKit.EntityFramework.Core project, so we can have some separation.

@StefH
Copy link
Collaborator

StefH commented Jul 31, 2018

If the domain project is also used by other applications which don't use Entity Framework, it makes sense.

However if the domain project is always used in applications which are using Entity Framework, it has no use to make a separation.

@vertonghenb
Copy link
Author

vertonghenb commented Jul 31, 2018

The domain project is also used by other applications which doesn't use Entity Framework.

StefH added a commit that referenced this issue Aug 8, 2018
@StefH
Copy link
Collaborator

StefH commented Aug 8, 2018

A solution would be to conditionally include the correct library in the domain project.
Example could be:

<ItemGroup Condition="'$(LibraryType)' == 'EF'">
    <PackageReference Include="LinqKit.Core" Version="1.1.15" />
  </ItemGroup>

  <ItemGroup Condition="'$(LibraryType)' != 'EF'">
    <PackageReference Include="LinqKit.Microsoft.EntityFrameworkCore" Version="1.1.15" />
  </ItemGroup>

Where you define EF or non-EF in the project where the domain project is used.

See 16934b8

Closing this issue for now.

@StefH StefH closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants