Currenty I am using an Entity Framework DTO generator called EntitiesToDTOs (see here and here) in Visual Studio 2013. Now I have upgraded to Visual Studio 2019 and this addin is not supported so is there any other similar tool to generate DTOs, and also convert Entity to DTO and viceversa?
Try this extension DTO Writer
Simple code generation tool for DTO-classes creation. You can easily create DTO-classes for your models in three clicks:
Make right mouse click in Solution Explorer on your .cs file that contains model classes.
Click "Create DTO" in context menu (You can find the same menu item in context menu of code editor area).
Click "OK" in creator dialog window.
Related
After Visual Studio 2013 reinstall I can't open / create edmx files
So I think I should download LINQ to Entities somewhere because I already used to try a lot of Entity related stuff...
Where can I get edmx designer for Visual Studio 2013?
Here's the link to the Entity Framework 6.0.2 Tools for Visual Studio 2012 & 2013:
http://www.microsoft.com/en-us/download/details.aspx?id=40762#
Edit:
Right-click on your project, select Add, select New Item...
Select Data from the left pane, select ADO.NET Entity Data Model, click **Add*
Select Empty Model and then click Finish
This should bring you to the Entity Data Model Designer where you can drag and drop entities and create relationships.
Is there a way to add a new Scaffold or override the Scaffolding functionality used in the new Visual Studio 2013 Scaffolding?
The only documentation I can find on the internet is how to override the T4 templates using the CodeTemplates folder. I want to add a new Scaffold to the list when Add... > New Scaffold Item... It looks like in Visual Studio 2013 this has been rolled into a library (Microsoft.AspNet.Scaffolding.Mvc.5.0.dll) and registered in the GAC or as a VS Extension.
http://weblogs.asp.net/imranbaloch/archive/2013/09/15/customizing-the-asp-net-mvc-5-web-api-2-scaffolding-templates.aspx?CommentPosted=true#commentmessage
I want to override the mechanism that calls the T4 templates so I can create different files and enhanced the functionality. My specific need is that I want to scaffold the old CreateOrEdit.cshtml and a new DetailsOrDelete.chtml partial views. I would also like to Scaffold a tool that takes a resource file and generates the localized resource file in another language.
In Visual Studio 2013 RTM there is no support for adding completely custom scaffolders. You can only do the following customizations:
You can edit or override the existing T4 templates for controllers, areas, views, etc.
You can add custom view scaffolders that will show up in the existing MVC View scaffolder
The Visual Studio team is working on re-enabling custom scaffolder support in a future update of Visual Studio.
To add a custom view scaffolder today:
Create any ASP.NET project in VS2013
Add a folder called CodeTemplates
Create a sub-folder in there called either MvcView or MvcViewWithoutModel depending on whether your custom view template is a strongly-typed view
Create a file there in the form of <templatename>.<lang>.t4 where the <templatename> is whatever you want to show up in the MVC View scaffolder's drop down list and <lang> is either cs or vb.
To get started you can copy any existing scaffolder from VS2013's default list and customize it. You can get the built-in scaffolders from here:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates\MvcView
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates\MvcViewWithoutModel
If you use the same name as an existing scaffolder then it will override the built-in scaffolder, even when called from another scaffolder. For example, the MVC controller scaffolder will use an overridden view scaffolder that is in your project.
4/22/2014 Update
Now that previews of Visual Studio 2013 Update 2 are available, it is possible to write completely custom scaffolders.
Check out this blog post that walks through how to write a custom scaffolder: Creating a Custom Scaffolder for Visual Studio
In eclipse the Add New Class wizard lets you specify all sorts of options, such as what modifiers the class has, what interfaces it implements, what its parent class(es) is, what package it resides in, etc.
Comparatively the default add new item wizard in visual studio while offering a large selection of templates does not offer such options.
Is there any way to get eclipse like functionality in Visual Studio through some setting or extension?
Visual Studio should have those capabilities right off the start, I would suggest going through the different menu such as Views, projects etc. take a look at this
http://msdn.microsoft.com/en-us/vstudio/cc136611.aspx if your new that is
Visual Studio has a different way of handling things. You add the class and then use the refactor menu to add any interfaces, etc. Right click on the class name -> refactor, or you can use the refactor menu.
I have Vs2010 ultimate. I installed asp.net mvc 4 and EF 5 that was part of it.
There is no db context generator template for EF 5 for visual studio 2010. Only for the RC of the next version.
Short of installing vs 2012. What are my options?
You can find the generators in VS gallery - EF 5.x DbContext Generator for C# or EF 5.x DbContext Generator for C# Web Sites; both are intended for VS2012 but perhaps you'll be able to make them work with VS2010.
Here is an alternate way to accomplish this:
In the Add New Item dialog box, at the section on the left where you choose the type of template, click on Online Templates and then perform a search for what you need.
In this case you would search for DbContext Generator, you will get many listings that look like EF 5.x DbContext Generator for C# or EF 4.x DbContext Generator for C#. Select the appropriate version based on the version of EF you have installed.
This is intended for and works right from within VS 2010 so you don't have to man handle anything. You should be all set.
Cheers!
Can someone please suggest that how can I open edmx file in design view. This is evrytime opening in XML view?
Right-click on the item and select "Open With..." - that should offer you the designer. You can also set the default from that dialog too.
I assume you're using a version of Visual Studio which supports the EDMX designer...
If it doesn't open it automatically, you probably don't have the SQL Server Data Tools installed.
You need to modify your Visual Studio 2012 install and select SQL Server Data Tools from the optional features list, which includes the EF Designer.
Or, here's a link to get it directly.
What is the source of your EDMX file?
If your file is from the $metadata endpoint of an OData service, then you can't open it in Visual Studio's EDM Designer. The OData metadata format is indeed EDMX but it is not compatible with Entity Framework's EDMX format.