self-tracking-entities

Self-tracking entities not recommended anymore. What is?

心已入冬 提交于 2019-12-05 09:55:54
Reading the msdn information on EF 5.0 and n-tier solutions see link , it seems that MS is not recommending STE's and the POCO/DTO way is also not recommended by stating that it is difficult. Not all (perhaps not many?) applications are suited for using WCF Data Services. So what is the way to go? My scenario is a current, large server (WebServices) application with many clients (only our own), mostly WinForms. Today DataSets are used to ship the data and track changes into the SQL Server database. We are now starting to replace WebServices with WCF and are also looking into using the Entity

Many queries and too much opening / closing of the same connection

為{幸葍}努か 提交于 2019-12-05 07:17:10
I have to recalculate values on a large collection of entities, one after the other. During that process, all the self-tracking-entities are altered within the same ObjectContext. For each entity that needs to be processed, small amounts of data has to be fetched from the database. That results in a lot of the same SQL query but using different parameters. I am using Solutions Design's ORM Profiler software to profile the queries that are sent to the database. The queries themselves seems okay to me. They are short and don't take much time to execute. However, I am confused about how the

How do I undo all changes made to a Self-Tracking Entity?

情到浓时终转凉″ 提交于 2019-12-04 19:18:41
I have a client application that downloads a number of STE's via WCF. Using a WPF application, users can select an entity from a ListBox, and edit it via a popup UserControl. As the UserControl is bound directly to the object, when a user makes a change it of course affects the object. I would like to provide a Cancel function which will undo all changes made to the entity. Any thoughts? You can keep a original copy of the entity. And edit a cloned version of it. If the user cancels the changes you simply keep using the original copy. I would say as you use WPF just in binded PropertyChanged

What are essential differences between the different code generation items for EDMX model?

戏子无情 提交于 2019-12-03 12:02:00
I'm trying to ramp up on the entity framework so I don't feel like I'm in the dark ages. I tried (and have thus far failed) to intuit from generated code what the essential differences between the available code generation items. It seems POCO isolates the entity data structures from the ojbect that moves them in/out of a datastore. I'm not sure what a "Self-Tracking Entity" is. I'm guessing the tracking part refers realizing the so called "unit of work" pattern, but I'm not posative. And more head scratchingly, I guess I'm wondering "self tracking as opposed to what?". Ladislav Mrnka POCO

Entity Framework Self-Tracking Entities not recommended by Microsoft

天涯浪子 提交于 2019-12-02 21:42:52
While looking at Microsoft's web site, I discovered that they no longer recommend using Self-Tracking Entities. Each link below is a MS resource that mentions not to use STEs: Shows what templates are available by the Entity Framework team: EF Designer Code Generation Templates Self-Tracking Entities Recommended technologies for N-Tier applications Does anyone know why Microsoft no longer recommends using STEs? Michael Edenfield (NOTE: As I don't work for MS this is all conjecture based on their public statements and past history). The first article you posted "sort of" explains the reason,

self-tracking-entities and lazy loading

筅森魡賤 提交于 2019-12-02 13:55:22
问题 Is there a way to use lazy loading and self-tracking-entities while the context is open? Will there be any issues and what do I have to consider? Thanks a lot for your aswer in advance. 回答1: Lazy loading is not supported with STEs at all because lazy loading demands dynamic proxy created over entity but STEs are not proxied by design - check additional notes in summary or MSDN question. 来源: https://stackoverflow.com/questions/6571954/self-tracking-entities-and-lazy-loading

EF 4 Self Tracking Entities does not work as expected

て烟熏妆下的殇ゞ 提交于 2019-12-02 12:03:52
问题 I am using EF4 Self Tracking Entities (VS2010 Beta 2 CTP 2 plus new T4 generator). But when I try to update entity information it does not update to database as expected. I setup 2 service calls. one for GetResource(int id) which return a resource object. the second call is SaveResource(Resource res); here is the code. public Resource GetResource(int id) { using (var dc = new MyEntities()) { return dc.Resources.Where(d => d.ResourceId == id).SingleOrDefault(); } } public void SaveResource

DDD using STE vs POCO

烈酒焚心 提交于 2019-12-02 10:57:42
Developing n-layered application with DDD (o better DDDD because we are using WCF) using Microsoft technology (where we have full controll of all component), the best choise seems to be STE vs POCO (this last one force the usage of DTOs). That's right? In your opinion make sense the usage of STE with DTOs where we need them? Thanks. I really can recommend Julie Lerman's Programming Entity Framework . She goes in depth about simple poco's, dto's and Self Tracking Entities. Advantages and disadvantages are described. But off course depending a lot on application requirements and personal taste.

EF 4 Self Tracking Entities does not work as expected

我怕爱的太早我们不能终老 提交于 2019-12-02 05:30:51
I am using EF4 Self Tracking Entities (VS2010 Beta 2 CTP 2 plus new T4 generator). But when I try to update entity information it does not update to database as expected. I setup 2 service calls. one for GetResource(int id) which return a resource object. the second call is SaveResource(Resource res); here is the code. public Resource GetResource(int id) { using (var dc = new MyEntities()) { return dc.Resources.Where(d => d.ResourceId == id).SingleOrDefault(); } } public void SaveResource(Resource res) { using (var dc = new MyEntities()) { dc.Resources.ApplyChanges(res); dc.SaveChanges(); //

Why doesn't WCFTestclient understand standard EF objects but understands STE objects

别说谁变了你拦得住时间么 提交于 2019-12-02 00:55:22
问题 When I try to consume a WCF service which expose operations that return standard EF objects I receive a warning on these operations. The warning states "This operation is not supported in the WCF Test Client because it uses type < EntityName >". The generated source code for the entities in my EF model contains ordinary C# classes, inherited from EntityObject and decorated with [EdmEntityType],[Serializable] and [DataContract] attribute. If I change the standard code generation process and