I Have 2 views. ProductForm.aspx and Category.ascx.
CategoryForm is a Partial View. I Call the Category.ascx from the ProductForm with EditorFor(model => model.Category) . In this partial view, there is a DropdownlistFor with all the category. The problem is the Selected Value for a specific Product Category. The selected value dosen't w...
Supposing my Application consumes two tables represented as two entities: Person and Employee.
And:
I am not allowed to make changes in table person. (I suggest get data from a view)
Employee must inherit from Person.
I am trying to implement Table-Per-Type inheritance, but I don't know how to insert rows in table Employee.
Employ...
I'm attempting to use RIA services with a Entity Framework back end. The Model was auto generated by the designer. (VS 2010, .NET 4.0, EF 4.0, SilverLight 4.0)
The issue that I'm running into is that Reference Properties are being loaded as expected at the Service Layer, but when that information is passed over to the SilverLight App the...
Hi,
When I set where clause of a EntityDataSource which contains a unicode column name, this exception occurs:
The simple identifier 'عنوان_قرارداد'
must contain basic Latin characters
only. To use UNICODE characters, use
an escaped identifier. Near line 6,
column 4.
and this is a part of my code:
GridDataSource.Where = "...
I have a UI & Library project for the solution where I'm having the problem. The library project uses Entity Framework & the unit tests work OK with it. The project is a C# 4.0 WPF application.
To try to get a basic EF line of code working I copied the connection string from the Library project app.config to the UI project app.config....
Hi
When i create a .edmx and i hit "Add code generation item" the POCO template is missing, i can only see Entity Object Generator and Sel-Tracking Entities Generator. What am i missing?
...
I use Entity Framework 4 and MVC 2.
I Have an Address Entity, Contact, Company.
There are a relation between Contact and Address and Company and Address.. A Contact can Have an Address and a Company can also have an address too.
I created a Partial View for Address.
<div class="editor">
<%: Html.HiddenFor(model => model.Ad...
Which one should I choose for new project? Could I assume, that data-first model provides better DB performance, and model-first provides better OOP handling?
...
In NHibernate SessionFactory is said to be a heavy object and it is suggested that SessionFactory should be created once in application life span. However once we get handle to SessionFactory, we do call open() on it before doing any DB operation.
In EntityFramework we need to create an object of ObjectContext every time before doing an...
Hi Guys,
This could be a simple solution, but....
If i have a Entity Framework 4 Repository which exposes the following interface:
void InsertOrUpdate(Foo foo);
And my EDM is done with custom POCO's (no code generation), how do i perform UPDATE's to POCO's?
I can INSERT a new object by doing this:
var newFoo = new Foo { ... };
rep...
Hi all,
I am starting on a new large project and I'd like to use EF4 for the data layer stuff, mainly for the POCO mappings feature.
Am I a fool for stating work against a CTP release? Should I wait for the RTM? Given my project will likley take 12 months, could the RTM be out by the end of my project?
I'm sure others have been in the...
Hi!
I know EF4 is still in development but as a newcomer to the subject, I need a document, tutorial etc. with EF 4 code first approach. All the info is in EF 4 Team Blog but scattered around different posts. A full coverage would be really nice.
Any one knows of a such place?
Thanks.
...
I am using C#, Visual Studio 2010 and Entity Framework 4. I have an assembly that contains multiple entity models. Project requirements are such that I am not storing any connection information in the app.config.
I have written a method that returns an entity connection string when I supply the name of the model I wish to load.
publi...
Is it possible to choose a specific database that will be used with the entity framework?
At this time, I use the connection string in the Web.Config as database authentication.
I have twelve databases, each of them has the same structure and the same stored procedure.
There is one database for each client. When a client wants to login...
In an MVC view, I'm looking for a way to determine if a parent entity's collection of child entities is empty, so I can decide if I need to call a RenderPartial() or not.
For a one-to-one I've been using the following:
<% if (Model.Book.GenreReference.EntityKey != null) %>
{.....}
but I'm unsure how to do it in a one-to-many sc...
I'm looking for an utility class to generate fake entity instances at runtime.
I'm implementing a ASP.NET MVC3 website using EF4 with a code-first approach, so I'd like to run the site before creating any database. The fake instances should contain valid data (hopefully reflecting the various DataAnnotation attributes used in each class ...
Hi I am using Entity Framework code only from CTP4. My question is this: given the name of a domain class which is mapped using an EntityConfiguration how can I retrieve the table name for the mapped class at runtime? I'm assuming I need to be using the MetadataWorkspace on the ObjectContext, but finding it difficult to get up-to-date ...
How can I preserve SSDL changes? each time I open Entity framework model designer it overrides and remove my casacade delete attribute added to SSDL manually for many to many relations. I am using Entity framework 4.0 and model first approach.
...
We are starting a new web based product in which we are planning to expose our business logic through WCF services. We will be using ASP.NET 4.0, C#, EF 4.0. In future we want to build iphone applications and WPF applications based on the services. I have been reading a lot about using POCO vs Self Tracking Entities (STE) and from my und...
OK, here we go, after reading a couple of related questions, I haven't ended into a real productive solution for my thoughts.
Thoughts:
As we all developers creating applications, then these apps going into production, the client after couple of days demands additional features.
Great! you open your database through Server Explorer, c...