I am learning to use .net core and EF core. I would like to use a tool similar to Sql Management studio to view the data in my ef core db. Is there a tool to view the data in the database?
Related
Microsoft provides two ways of working with cosmos dbs in C#/.NET.
One can either use Entity Framework(EF) Core, which makes use of the cosmos SDK behind the scenes and allows you to use EF with Cosmos.
This last point could be seen as positive or negative depending on if you want to use EF vs Dapper or whatever, but for my use case, I would prefer to use EF unless given a good reason not to.
Microsoft themselves has not made any statement I can find on which should be used or why. (I Assume this is a .NET Core project)
EF Core works only for SQL API of Cosmos DB as of now. So, If you are using other APIs, you cannot use EF Core.
Also, Take a look at other limitations of EF Core Azure Cosmos DB Provider Limitations at https://learn.microsoft.com/en-us/ef/core/providers/cosmos/limitations
We used Cosmos DB SDK which is quite flexible and the performance is also good.
After an experience with Cosmonaut package, EF Core and SDK I have to say that Ef Core is focused on relational mapping. Witch Document DB you need to focus on Json serialization. Ef Core model configuration feels cumbersome and limiting for document DB interaction - You have to configure things that just works while serializing. Both Cosmonaut and SDK allow focusing on serialization which in most cases just works. Cosmonaut is a convenient facade on top of SDK - but looks dead at the moment so I recommend SDK.
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.
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.
I have a .NET WPF project which is using SQL Server CE 4.0 with Entity Framework.
I want to rework it into a Xamarin Forms project. I think the 'migration' of the backend will be almost seamless, except for the data access layer. I am confused as to what Xamarin supports. I can't use SQL Server CE with Xamarin forms, can I? What about SQLite? It is supported, as far as I can tell.
Ok, but then what about ORM? Right now I am making a heavy use of the EF navigation properties. Is there any way I could preserve this with SQLite?
How would you go about converting code which relies on EF and navigation properties, backed by SQL Server CE, to SQLite, while preserving the mentioned navigation properties?
Can I use Entity Framework with SQLite, on Xamarin Forms?
EF Core supports SQLite, yes.
And SQL Compact is supported with EF Core, but only on Windows desktop.
Support for EF Core with Xamarin Forms is still in progress, see this: https://learn.microsoft.com/en-us/ef/efcore-and-ef6/features
[Environment]
Windows 7 Ultra
VS 2010 Ultra
Entity Framework 4.2
Entity Framework Power Tool CTP1
[Details]:
I'm doing some exercises about EF Code-First. During doing it with local server of SQL Sever 2008 Express, the EF Power Tool can display the entity data model diagram. it works well.
After I define a connectionstring in app.config to connect a LAN server of SQL Server 2008, view the entity data model again. The EF Power Tool shows me a dialog of error HResult 0x000xxxx. By running the application, it rebuilds the tables in database as I expect.
I found a comment in the page of downloading EF Power Tool CTP1. The Devart team gets the problem like me.
http://visualstudiogallery.msdn.microsoft.com/72a60b14-1581-4b9b-89f2-846072eff19d?SRC=VSIDE
[Question]:
Is any tool like the EF Power Tool to create data model diagram with POCOs and DbContext?
How to do to fix the problem above?
THX
Unlike EF Power Tool, Devart Entity Developer allows you to create data model diagram with POCOs and DbContext at design time initially. Please take a look at this article.
Since there is the problem with usage of existing DbContext with connection string from the *.config file, you can be interested in generating Code-First fluent mapping by Devart Entity Developer.
However, if you are going to use EF Power Tool, please take a look at this article.
Devart Team