Where is the EDM tool in Visual Studio 2013 Ultimate Trial? - visual-studio

I just installed VS 2013 Ultimate Trial and I noticed there is no EDM option as shown in the following figure.
Why?
According to ADO.NET Blog, the tool should be available out of the box.

From Visual Studio 2013 onwards we will no longer include the extension that enables configuring an "EDM" data source in this way, e.g. if you add an .MDF file to a project you will no longer see the option to create an EF model, and the option of creating an "EDM" data source based on an existing EDMX model as well as the ability to drag and drop to create data-bound controls automatically in WPF application based on those "EDM" data sources are no longer included.
The recommended ways to create an EF model are either creating the classes,manually (Code First) or adding a new "ADO.NET Entity Data Model" using Add New Item.
The recommended way to do data binding against EF models in WPF applications is through use regular object data sources as explained in this walkthrough.

Related

UWP database designer for SQLite

I am following this tutorial and it seems you have to build all the relationships manually.
Is there any database visualizer/designer for visual studio which will help you to easily create an SQLite database?
Something like this one:
TL;DR: Currently there's no official support in UWP to create your database from a designer AND have both the SQL and C# code generated.
If you're using EF Core with code first as done in the tutorial you're following, then there's no designer to help. After all it is 'code first' not designer first.
If you really want to design your database, you can use ErikEJ's Visual Studio Extension called SQLite / SQL Server Compact Toolbox . This will help you to design the database, but then you won't have a way to generate the C# DBContext and Entity classes for UWP, as UWP only supports EF Core (not EF 6).
So you'll either have to write the models yourself after designing the database and you're back at step 1 (so what's the use of using a visual designer), or write SQL queries yourself using SQLite.NET-PCL or any other SQLite NuGet package.

How to Use Entity Framework 4 with Visual Studio 2013

We have recently upgraded our Visual Studio from 2010 to 2013. With it came EF 6.0, which is incompatible with the code generated from EF 4.
I need to update a table in the model with the latest version from the DB schema. When doing that, both "Update" and "Add" after deletion of the table definition do the following:
Remove all custom code already written for all types in the model, even if they are in separate files than the model;
Generate the new EF 6.0 bindings;
(optionally) Generate the new repository.
Now, that's obviously not the same behavior as in EF 4, which only regenerated the repository and did not touch the custom code.
We are not using NuGet, but referencing the EF library inside the project.
I guess VS 2013 uses a different version of the code generator than VS 2010. How can we revert to the old behavior?
UPDATE:
I have tried using NuGet to download EF 4.3.1 and repeat the update model steps (also delete and then recreate), but I am still seeing the old behavior. I think there is a problem with the VS 2013 EF Code Generator.
For me, the following solution worked.
Double-click on your edmx file and open its properties window. Change Code Generation Strategy from T4 to Legacy Object Context. Build your solution. It may cause thousands of errors because you have redeclared functions and properties, so remove all files that weren't there before.

Table Valued Functions in EDMX with Entity Framework 5 / Visual Studio 2010

If it possible to use table valued functions in an EDMX with Entity Framework 5 RC / Visual Studio 2010?
I cannot see the option in the EDMX designer, I have a feeling that the designer is in .net 4.5? Are my suspicions correct? Or perhaps in Visual Studio 11?
I'm not really in a position to be able to upgrade our project to .net 4.5 yet, is there another way of using table valued functions (perhaps modifying the edmx by hand?).
ADDITIONAL INFO:
This blog post on msdn helps confirm the incompatibility:
Some features are only available when writing an application that
targets .NET 4.5. This includes enum support, spatial data types,
table-valued functions and the performance improvements. If you are
targeting .NET 4.0 you still get all the bug fixes and other minor
improvements.
However interestingly, this tutorial discuses modifying the EDMX directly to add support for TVF, but it appears to be for a an old beta. The XML intellisense also didn't find the elements discussed in the tutorial, but it might be because it was using a different schema. Unfortunately I've run out of time to try and apply the tutorial to the new EF5 Release candidate, but I'd be interested in knowing if anyone has had any luck.
Unfortunately table valued function support is currently dependent on .NET 4.5 and VS 2012.
I have been using this approach in order to use table-valued functions from EF 4. Basically it includes hand-editing the EDMX file. The downside to that approach is that you need to edit the file manually whenever you update your model.

How to find dbcontext template in Visual Studio 11

I'm using database first approach to create a model with entity framework. In VS2010 after the model was generated I always choose a different code generation template (right click on diagram "Add new code generation item") then, in the dialog box, choose "DbContext Generator". This will instruct VS to generate POCO classes instead of the, very complex, standard class. When I tried to do the same in the Visual Studio 11 Developer Preview I can't find the template "DbContext Generator" in the dialog.
How can I add the dbcontext template to the Visual Studio 11 Developer Preview?
I saw I can use nuget but I'm unable find it when I do a search.
Can you add the Entity Framework Power Tools via the Extension Manager? Then in a class library, you can right-click and "Reverse Engineer Code First". That will pull your database in and create everything you need (no need for EDMX and TT files). You will need to have EF 4.1 installed or have added the EntityFramework NuGet package to your project before running reverse engineer.
I don't have VS 11 installed here, so can't check if the tools will install (I'm also not sure whether these features are being rolled into 11) but anyway will work great in 2010 as I frequently use it.
Richard
In February Microsoft release a dbContext Generator that works on Visual Studio 11 Beta.
The link to download this generator is:
http://visualstudiogallery.msdn.microsoft.com/da740968-02f9-42a9-9ee4-1a9a06d896a2?SRC=VSIDE
Hope it helps.

What's Differences Between Using Entity Framework in Vs 2008 And 2010

You know firstly Entity Framework came with Visual Studio 2008 SP1. Now it is come with Visual Studio 2010.
The question is that, what are differences between these two version?
Persistence Ignorance: You can define your own POCO’s (Plain Old CLR Objects) that are decoupled from any specific persistence technology. This allows you to swap out one data access stack for another should the need arise.
T4 Code Generation: EF 4 will ship with a number of T4 code-generation templates which you can customize or replace with your own. (T4 is a code-generation technology built into Visual Studio 2008 or later.)
Lazy Loading: In addition to eager and explicit loading, related entities can be loaded automatically on demand. For example, with an Order class that has an OrderDetails property, marking this property as virtual will cause order details to be loaded from the database automatically when the OrderDetails property is enumerated.
POCO Change-Tracking: EF4 will support two models for tracking changes on POCO’s. By default EF will take a snapshot of the original state of your objects and then compare it to the current version when saving changes. Alternatively, you can define properties as virtual so that their state is continually tracked and kept in sync with the object state manager.
Better N-Tier Support with Self-Tracking Entities: The first CTP for EF4 includes a T4 template for generating entities that track their own changes on the client, which are then serialized when sent across service boundaries and saved to the database.
Model-First Development: Create a model for your entities, then have Visual Studio 2010 generate DDL to create a database with matching tables and relations.
Code-Only Development: Write classes and have EF infer a conceptual model (no edmx file!). You can even generate DDL from the dynamic model to create the database and tables.
cited from DevelopMentor
what's new in EF

Resources