Set entity framework DDL generation language - visual-studio-2010

I am using Entity Framework with Visual Studio 2012 or 2010. I am working together with colleagues who have a different language version (German) of Visual Studio installed.
Some of our models use inheritance. When generating the database from the model (using standard values: TablePerTypeStrategy.xaml and SSDLToSQL10.tt) EF generates inheritance constraints. The names of these constraints are localized (x_inherits_y vs x_erbt_y). This means, every time someone makes a change to the model and generates the SQL file all the constraint names are updated with the localized version.
This is starting to become a major annoyance as we need to know the names of the constraints. Sometimes we need to update already deployed databases and there is no way to know whether they have been created with the German or English constraint names. This makes writing update scripts impossible without access to the database.
Is there some way to prevent Visual Studio from localizing these names other than force all developers to use the same Language version?

Related

Creating a project in Layered Architecture in Visual Studio

I am a developer who has developed applications in Java from the beginning. But now I have to switch into C#. Even though those two languages are quite similar, I find it difficult to get used with the IDE; which is the Visual Studio.
I have used Eclipse and NetBeans for the projects I have done using Java. Coming from them, I find the Visual Studio environment different in big manner.
I am trying to develop a simple application which has 3 separate layers of coding like Model-View-Controller. In fact I am developing a WPF application. In that, I need my view code to be in a one layer, data models and all the database related stuff in another separate layer and the code in between the View and the model in a separate layer.
In java, When we use Eclipse or NetBeans, what we do is we create 3 separate packages for those 3 layers. But I cannot figure out how to create different packages in Visual Studio. As I see, in C#, namespaces are used instead of packages. Isn't it? But I don't know how to create different namespaces and different classes in those namespaces. (Just like we create a new class inside the packages created in Eclipse)
I am bit confused here in this case. How can I create different packages (or namespaces) in Visual Studio & how to create the project structure as I need ?
Thank You..!

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.

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.

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

LINQ to SQL in Visual Studio 2005

I normally run VS 2008 at home and LINQ is built in. At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL.
After doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have to be installed for LINQ to work in VS 2005.
Does someone know the proper add ins or updates I would need to install to use LINQ in VS 2005 (preferably without having to use the CTP mentioned above).
You can reference System.Data.Linq.dll and System.Core.dll, and set your build target for C# 3.0 or the latest VB compiler, but everything else would have to be mapped manually (no designer support in VS2005 in LINQ to SQL RTM).
It's no longer legal to use the May CTP (the beta software).
It's not legal to deploy System.Core.dll (among others) without installing .Net 3.5
The best way to do LINQ in VS2005 is to use LINQBridge for LinqToObjects, and to use simple table adapters or some other data access method to punt your data into objects (for further in-memory querying).
Also note: LinqToObjects expects Func(T) - which are essentially delegate types. LinqToSQL requires Expression(Func(T)) - which are expression trees and much harder to construct without the lambda syntax.

Resources