entity-framework-4

Why does my new .Net 4.0 EF application randomly lock up?

两盒软妹~` 提交于 2019-12-21 06:02:31
问题 I have recently rolled out a new ASP .Net application. This application uses .Net 4.0 and the Entity Framework 4. It is a "basic" CRUD application. I almost exclusively used the EntityDataSource for Data Access. The users have reported "ocassional freezing" of the application (they all use IE 8). If the user closes his browser and starts back up, the app is fine. It happens maybe once or twice per day total, usually to the heavy users. (So, I have been leaning toward memory leack or some

Partial postback of page with dropdownlist using AJAX on MVC3 page EF4

99封情书 提交于 2019-12-21 05:51:34
问题 I have a dropdownlist which lists Country names When user select any country from dropdown list.Based on the country selection, I need data(AgencyName, AgencyAddr,Pincode) to be loaded from database and fill the TextBoxs on the right side.The selected country in the dropdown should remain selected. on selection change of dropdownlist ,I do not want the entire page to postback .Please help me Here is my EF4 - ModelClasses public class Country { public int CountryID { get; set; } public string

How can I stop EF Reverse Engineer changing plural to singular with Table names?

会有一股神秘感。 提交于 2019-12-21 05:48:15
问题 CREATE TABLE [dbo].[ContentStatus]( [ContentStatusId] [int] NOT NULL, [Status] [nvarchar](50) NOT NULL ) Creates: public partial class ContentStatu { public ContentStatu() { this.Contents = new List<Content>(); } public int ContentStatusId { get; set; } public string Status { get; set; } } 回答1: I was unable to solve your same issue of tt singularizing words ending in 's' as well while using VS Power Tools Beta 4 despite the fix for entityframework.codeplex.com/workitem/446 being posted and I

Entity Framework - related ICollection getting materialized into HashSet

柔情痞子 提交于 2019-12-21 04:52:29
问题 I use EntityFramework POCO + proxies + lazy loading in my project. Today I was pretty surprized to see that the class Transaction has its related collection Rows materialized into HashSet (instead of EntityCollection ). I need EntityCollection for tracking changes in the collection. public class Transaction { public virtual ICollection<TransactionRow> Rows { get; set; } } However other entity classes have their related collection materialized into EntityCollection . I am loading the

EF4 POCO WCF Serialization problems (no lazy loading, proxy/no proxy, circular references, etc)

可紊 提交于 2019-12-21 04:34:15
问题 OK, I want to make sure I cover my situation and everything I've tried thoroughly. I'm pretty sure what I need/want can be done, but I haven't quite found the perfect combination for success. I'm utilizing Entity Framework 4 RTM and its POCO support. I'm looking to query for an entity (Config) that contains a many-to-many relationship with another entity (App). I turn off lazy loading and disable proxy creation for the context and explicitly load the navigation property (either through

How to use Entity Framework + PostgreSQL from connection?

妖精的绣舞 提交于 2019-12-21 04:29:14
问题 I have already seen threads discussing the use of Entity Framework and PostgreSQL with official instructions. Those instructions need to run gacutil for every install which is not so handy for deployment purposes. What I want to do here is passing PostgreSQL connection directly to the DbContext constructor. This is enough for me because I am going to use CodeFirst without designer. This is what I do: public class Context : DbContext { Context(System.Data.Common.DbConnection connection) : base

How do I create a migration for an existing database in EntityFramework 4.3?

随声附和 提交于 2019-12-21 04:28:17
问题 so I want to get started with EntityFramework 4.3 migrations. I wanted to know if I can convert an existing database to a migration-enabled database and have EF assume that only changes from then on should be considered migrations. 回答1: A nice walk-through for this is posted here: http://thedatafarm.com/data-access/using-ef-4-3-code-first-migrations-with-an-existing-database/ The one change I would suggest is to simply comment out the code in the Up and Down methods until you have deployed

Implementing the Repository Pattern in ASP.NET MVC

三世轮回 提交于 2019-12-21 04:25:12
问题 I am still having a hard time wrapping my head around this. I want to separate my layers (dlls) like so: 1) MyProject.Web.dll - MVC Web App (Controllers, Models (Edit/View), Views) 2) MyProject.Services.dll - Service Layer (Business Logic) 3) MyProject.Repositories.dll - Repositories 4) MyProject.Domain.dll - POCO Classes 5) MyProject.Data.dll - EF4 Workflow: 1) Controllers call Services to get objects to populate View/Edit Models. 2) Services call Repositories to get/persist objects. 3)

Using “Include foreign key column in the model” option in EF wizard

拜拜、爱过 提交于 2019-12-21 03:57:17
问题 Do you mostly use this option (the default is checked) or do you uncheck it? I found out that when I have both FK column and navigation property on my entities it results in problems with mapping tools - they might bind one or the other but almost never both. If we were to follow the guidelines of conceptual models strictly I think those columns should never make it to properties, should they? Hopefully many of you reply so we can get a better representation of what developers choose more

Entity Framework 4 vs LINQ to SQL, for small or medium-size apps, working with SQL Server

泪湿孤枕 提交于 2019-12-21 03:46:15
问题 I've seen some discussion about L2S vs EF4 on Stack Overflow back in April, when VS2010 was launched, namely: Dump Linq-To-Sql now that Entity Framework 4.0 has been released? Is Entity Framework worth moving to for a new small app? Now, after 6 months, presumably people have had more interacting with EF4, so I'm curious of fresh opinions, especially when considering working only with SQL Server. I've used LINQ to SQL a lot, and only played a bit with EF4. I wouldn't mind jumping in and