Installing a package which depends on Entity Framework via NuGet - entity-framework

Okay, so I have an internal library for entities, and I have a web application which depends on the library.
So the dependency looks like this:
Web Application
Library
Entity Framework
The library is managed via an internal NuGet feed.
The problem I have is that every time I update the library within the web application, the install.ps1 script gets run for Entity Framework. This creates an EF folder (along with with Model1.tt, Model1.cs, Model1.Context.tt, Model1.Context.cs files) within the web application.
I don't want this obviously, so every time I update the library project, I have to delete files from the web application.
I feel there's something I'm missing here - how do I get to use Entity Framework as a dependency without it creating the EF folder every time I update the library project within the web application?

Related

Unit test failing after adding framework to framework project

I have a framework project that I've added a framework to. The existing project has a test target, since I've added a third party framework I now get the following error:
Library not loaded: #rpath/JWT.framework/JWT
I have tried adding the framework to the test target's build phases Link binary with libraries section with no success.
This error typically occurs when the app is unable to load a framework at runtime. One cause of this could be that the framework isn't embedded in the built app.
Aside from the Link Binary With Libraries build phase, you'll also need to ensure that the framework in question is added to the Embed Frameworks build phase in order to ensure it's bundled into the final app.

Reference .net core 2.0 into a .net 45/46 project

How can I add a reference of a .Net Core 2.0 project into my .Net 46 project?
My project is structured as follow:
Solution
- Data Project (.Net Core 2.0)
- Test Project (.Net 46)
I'm trying to reference the Data Project into my Test Project as I need to insert some data using it. The only reason I created a .Net Core 2.0 is that I'm trying to use Entity Framework on Visual Studio for Mac and it didn't work using the "normal" Entity Framework nuget package, so I opted for the EntityFrameworkCore.
I was able to manually reference the Data Project dll, but then when I run a test I get the message
"Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.0.0.0. Culture=neutral' or one of its dependencies"
Is there any solution for this? If not, what's the best way to work with Visual Studio on Mac and Sql Server when you need to retrieve and insert data? Would Dapper work?
Thanks
What you asked is impossible.
.NET Framework projects can only consume .NET Standard Class Library projects, but not .NET Core projects.
See the reference for more information,
https://blog.lextudio.com/which-class-library-project-to-go-in-visual-studio-2015-2017-a48710cf3dff

Installing EF to .NET core library project

I am new to .NET core. Trying to get used to it. But its kind of complicated.
I have my poco classes in 'solution.Entity' library project and I want to use them to create a database with EF code first in my 'solution.Data' library project.
But when I try to install Entity Framework via Nuget to my 'solution.Data' project it says 'Package Restore Failed. Rolling back...'
Both projects are .NET Core Library projects.
What do I need to do to be able to use EF in .NET core library projects? It's look like I need some kind of configuration.
Thanks for helps.
Make sure you're installing EF Core. .NET Core has it's own implementation of Entity Framework.
This should be the NuGet package you're installing.
There are lots of pieces to getting Entity Framework Core working right. I highly recommend taking a look at the docs. There are dozens of samples that show how to setup a project.
https://github.com/aspnet/EntityFramework.Docs
http://learn.microsoft.com/ef/
In particular, I suggest this guide. It will talk you how to take your POCO classes and make a database in a .NET Core project. You will likely find it easiest to keep.everything in one project for now and move code into separate libraries once you get more familiar with EF.

CQ5 - Separate out a servlet's business logic into a standalone bundle

I am new to java, osgi, bundles, cq5 console etc..
Can someone please point me to a tutorial or a starting point from where I can learn how to do what I am trying to achieve.
Basically we have common search functionality in 3-4 CQ5 websites, all of which reside on a single cq instance. This same functionality is implemented in all websites as a servlet and is called from client side using javascript. Redundant code....
We would like to:
a) take this servlet's code out from all the websiteName-core bundles where it resides repeatedly as of now.
b) create a single separate standalone installable OSGI bundle which only contains a servlet.
Then we would like to call this single separated out bundle from all our CQ5 websites's client side.
Aprt from code redundancy, we wish to make this common search bundle shippable so that other development teams can use it in their projects by just installing it in their console and calling the servlet.
Long story short. I want to create an OSGI bundle that has a servlet.
I wish to have an understanding of the whole game here and would prefer to get a tutorial link that explains it from start to end.
You can start by turning the search code into a separate maven multi module project.The archetype and instructions for creating one can be found on adobe's documentation site (link)
The maven multimodule project will have two module's Bundle and content. Bundle will hold all the servlets, OSGI services and back-end stuff. The content module will have all the UI and authoring related stuff like templates and components. It maps to the repository on the CQ server. The UI nodes are serialized and stored on flat file systems as XML documents.
Since it is a maven project on it's own, it's dependencies will be self contained. In the bundle module add the search servlet and all the required classes. The compiled package of this project will be shippable.
As long as the package is installed in the server, any other website will be able to make calls to it.
Servlets in sling are implemented as OSGI services of javax.servlet.Servlet class. Any exported service of the Servlet class will be recognized by the sling servlet resolver, You can get more details of it at this link
Sharath Madappa's answer is correct if you want to create a set of related bundles and distribute them as a CQ content package.
If you just want to create a single bundle to package some OSGi services (including servlets) you just need to build the bundle jar with the required metadata. The Apache Sling GET servlets bundle is a good example of that.

Deploying Entity Framework 5 in production without using Nuget

Using the Nuget package I downloaded and used Entity framework. I created a class library use the Entity framework and another windows forms application that uses the library to create data.
While deploying to production, I used with Windows Forms Application bin content but EntityFramework.dll is not part of it.
My question is :
How to deploy/install the Entity framework into production without using Visual studio/Nuget package?
Appreciate your responses.
If you set the Entity Framwork reference to Copy Local = True, it should deploy into your bin folder when you build the project