Visual Studio for Mac add ADO.NET Entity Data Model template - asp.net-web-api

How would I add the ADO.NET Entity Data Model template to my WebApi project in Visual Studio for Mac?

In Mac, to add a Data Model using the DataFirst technique you need to use the scaffold command.
https://www.learnentityframeworkcore.com/walkthroughs/existing-database
In the above blog, this process is explained neatly.

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 scaffold views from controller separately

I'm wondering if Visual Studio 2013 has any way to scaffold views using the controllers in MVC. I want to use a repository pattern, so for now I created that myself, and I would like to generate the views.
In Visual Studio 2012 I used the technique explained here by Scott Hanselman, but with the new scaffolding introduced in the new version of Visual Studio I was wondering if this is not supported natively
The scaffolding functionality appears to be embedded in Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Microsoft.AspNet.Scaffolding.Mvc.5.0.dll and I can't find any way to customize it further. So if there isn't a built-in means of scaffolding the way their used to be, it looks like you're doing to have to roll your own mechanism.

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

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.

Entity Designer Database Generation Power Pack not working in VS2012

I was developing MVC3 web site using VS2010 and for model generation i used EF 5.0 and for database generation i used Entity Designer Database Generation Power Pack (model first approach).
Now i m shifting from VS2010 to VS2012 for same project and need to edit my entity model so i added new entity in my edmx file and i'm going to generate my database using my entities then it is showing me error generate migration t-sql and deploy.xaml not exits .
I'm googling for this but not yet get solution.
How to resolve this issue ?
Entity Designer Database Generation Power Pack is not supported on VS2012.

I cannot find template ADO.NET Entity Data Model in VS2010

In VS2010, I cannot find the template ADO.NET Entity Data Model from the Data section.
I was doing:
create a silverlight(version 4th) project with a WebSite
right click the web project, Add -> New Item -> Data Section(actually, I tried every one)
But I cannot find it!! It's weird!
Then,
I tried to reset my VS template, it didn't work
Tried to re-install VS2010, and I got the "Successful" message. also I am sure that the ADO.NET Entity Framework has been installed appropriately.
So, is there anything else I can do? can I just install this template to VS?
i believe you can add a ADO.NET Entity Data Model in a windows class library
and reference that library where it is required. but you cannot add the data model in a silverlight library.
Update:
in that case, i presuming the website is atleast targeting version 3.5 of the framework
for vs2010, you can check that the required template is available at the locations below
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Data\1033\AdoNetEntityDataModelCSharp.zip'
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\VisualBasic\Data\1033\AdoNetEntityDataModelVB.zip'
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\Web\CSharp\1033\AdoNetEntityDataModelCSharp_ASPNET.zip'
'%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetEntityDataModelVB_ASPNET.zip'
(in a x64 environment use 'Program Files (x86)' for %programfiles%)
hope that helps.
-ryan

Resources