How to use Entity Framework and OData in vNext MVC - entity-framework

Is there any way to use Entity Framework in vNext MVC 6 (in the current release). Well, I found no option in "Add new item" of VS14 ctp and if we do manually there is some DB update problems (as i tried in earlier versions) and whats the neuget package available for Entity Framework and oData and how to use them. Please help

There is not yet support for OData in ASP.NET vNext, but there is a new version of Entity Framework: EF7. You can learn more about getting started with Entity Framework 7 here: https://github.com/aspnet/EntityFramework/wiki

Related

Entity framework support in .net core 2.1

I have created a new application, using the SPA templare of .netcore, to this solution i want to add another project to handle the database connection(DAL).
When i am adding ASP.net core Web Application to this solution, i then want to add to id an ADO.net entityframework template, but in the data section, it dont appear:
So I end-up adding a class Library(.net framework)
and to it i can add an ADO.net Entity Data Model
So now in the solution, i have 2 projects, 1 is .net core 2.1 for the API's, models and views(by angular).
The second project is a .net framework 4.6.1, class library project.
My question is, is it suppose to be like that?
is it a good thing to mix different frameworks
Please see this article regarding what each framework is, and what each is specifically designed for.
https://learn.microsoft.com/en-us/dotnet/standard/frameworks
In a nutshell, your requirements drive which framework you choose.
I would recommend sticking with EF Core (just my personal opinion, take it or leave it) The EF Core method of database first is only recommended if you require a 1 time migration from a source database. Microsoft Doc
If you need to CONTINUE working with an entity model past the first migration, it would be in your best interest to use Entity Framework 6, on a .NET Framework library like you have. But that doesn't stop you from using EF Core as your OR/M, because you can indeed have .NET Core reference .NET Framework.

Deploy Entity Framework Core 2.0 alongside EF 6?

Is it possible to deploy / install Entity Framework Core 2.0 alongside traditional Entity Framework 6? Is it fully possible, or possible but with some hang-ups, or not possible? Is this documented somewhere? I think I've seen they said they designed it to be side-by-side, but I'm having a hard time fully confirming this. Thanks.
The official documentation says the following:
It is possible to use EF Core and EF6 in the same application. EF
Core and EF6 have the same type names that differ only by namespace,
so this may complicate code that attempts to use both EF Core and EF6
in the same code file.
If you are porting an existing application that has multiple EF
models, then you can selectively port some of them to EF Core, and
continue using EF6 for the others.
This means of course that you can install both EF6 and EF Core in the same project. I have done this in a few simple cases myself and it was working ok.

How to use Entity Framework Core in XAF

Is it possible to use Entity Framework Core 1 (formerly Entity Framework 7) in XAF (eXpress Application Framework)?
Yes.
Does XAF support Microsoft’s Entity Framework?
Yes. XAF provides support for Entity Framework. You can use your existing EF data models in order to generate an XAF application. Please review the Business Model Design page to learn more.
From https://www.devexpress.com/Products/NET/Application_Framework/presales-faq.xml
UPDATE
To clarify, it is possible to use EF Core because XAF runs on .NET. If what you are asking is "does XAF work out-of-box with EF Core?" the answer is no. XAF's baked-in class EFObjectSpace is for EF6 and older because it relies on the ObjectContext API. EF Core does not support the ObjectContext API.
In v20.1, we have published GitHub examples illustrating how to access data protected by the DevExpress XAF Security System with Entity Framework Core 3 in non-XAF apps (they use the new EFCoreObjectSpaceProvider and SecuredEFCoreObjectSpaceProvider API).
For more information, please review Frequently Asked Questions and this feature and architecture overview.
XAF 22.2.3 supports EFCore 6.0.3
Note when upgrading old projects the primary keys in the security system have changed to GUIDS.
I managed to do the migration by creating a new .net core5 project from the wizard and then moving my classes into the new project.
Unfortunately The .Net5 security tables are different to those that the framework project uses so I wont be able to do a staged roll out.

Is it possible to use Entity Framework with SharePoint?

Are there any compatibility issues when using EF with SP?
Is there any particular version of EF that needs to be used with SP-2010/2013?

Updating my EF model to use 4.1 when I built it in 4.0

I built my EF Model in EF 4.0, and then installed the 4.1 upgrade that includes the new DBContext interface. How do I update my model so that it uses the 4.1 features going forward?
Thank You
You can use DbContext with your EDMX model. After installing EFv4.1 you should have new T4 template available: DbContext generator. This will take your EDMX and create context derived from DbContext and all POCO entities for you. Here you have walkthrough.
But if you want to switch to DbContext just because of DbContext.Entry.State you don't have to. EFv4 has a similar mechanism:
context.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
Here is the full description how to update an entity in EFv4.
What beneftis are you hoping to see by upgrading from EF4.0 to 4.1? You're obviously not going to benefit from using model-first development since you already have an existing model. You can already generate POCO objects from EF4.0. See Entity Framework upgrade from v4 to v4.1(RC)