self-tracking-entities

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

末鹿安然 提交于 2019-12-01 23:41:07
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 instead produce Self Tracking Entities (STE) I receive classes which are also decorated with the

How to track entity changes with WCF Ria Services?

拈花ヽ惹草 提交于 2019-12-01 11:54:30
问题 I need to log changes made to an entity that occur on the client to a database table. However, when I make changes and inspect the ChangeTracker property, it claims that no changes have occurred. [Service] private static readonly ISomeDao someDao = DataAccess.SomeDao; [Query] public List<SomeEntity> GetSomeEntites(int someId) { var entities = someDao.GetSomeEntites(someId); entities.ForEach(e => e.StartTracking()); return entities; } [Update] public void UpdateSomeEntity(SomeEntity entity) {

Entity Framework & Self-Tracking Entities vs POCO

大憨熊 提交于 2019-12-01 06:41:40
If i'm wanting to use entity framework 4 as my data layer and want to send my entities to another tier whether it be via WCF or another mechanism and then want the ability to update the entities and send them back for updating/deleting/inserting is it best to use self-tracking entities or poco objects? I'd rather use POCO objects if possible because i don't want to depend on the entity framework in the other layers if possible but i don't know how difficult it is to reconnect POCOs to the context. Ladislav Mrnka This is combination of too many questions and most of them were already asked on

Where to place the entity framework in our solution?

南楼画角 提交于 2019-12-01 06:24:36
Okay, so we have a solution that contains the following projects: BusinessLogic Entities DataAccess Utilities UnitTests UserInterface It is a very large enterprise-level application. My question is, where do we put the entity framework? On one hand EF seems like a data access technology and should go in the DataAccess project. But then on the other hand it generates its own entities and those should be placed in our already large Entities project. Which project is the better place for Entity Framework? Is it possible to split up the entities from the persistence logic in EF? Place EDMX file to

Entity Framework & Self-Tracking Entities vs POCO

北城以北 提交于 2019-12-01 04:32:24
问题 If i'm wanting to use entity framework 4 as my data layer and want to send my entities to another tier whether it be via WCF or another mechanism and then want the ability to update the entities and send them back for updating/deleting/inserting is it best to use self-tracking entities or poco objects? I'd rather use POCO objects if possible because i don't want to depend on the entity framework in the other layers if possible but i don't know how difficult it is to reconnect POCOs to the

Where to place the entity framework in our solution?

a 夏天 提交于 2019-12-01 04:06:34
问题 Okay, so we have a solution that contains the following projects: BusinessLogic Entities DataAccess Utilities UnitTests UserInterface It is a very large enterprise-level application. My question is, where do we put the entity framework? On one hand EF seems like a data access technology and should go in the DataAccess project. But then on the other hand it generates its own entities and those should be placed in our already large Entities project. Which project is the better place for Entity

How would I know if I should use Self-Tracking Entities or DTOs/POCOs?

╄→гoц情女王★ 提交于 2019-11-30 05:29:53
What are some questions I can ask myself about our design to identify if we should use DTOs or Self-Tracking Entities in our application? Here's some things I know of to take into consideration: We have a standard n-tier application with a WPF/MVVM client, WCF server, and MS SQL Database. Users can define their own interface, so the data needed from the WCF service changes based on what interface the user has defined for themselves Models are used on both the client-side and server-side for validation. We would not be binding directly to the DTO or STE Some Models contain properties that get

How would I know if I should use Self-Tracking Entities or DTOs/POCOs?

心不动则不痛 提交于 2019-11-29 03:25:24
问题 What are some questions I can ask myself about our design to identify if we should use DTOs or Self-Tracking Entities in our application? Here's some things I know of to take into consideration: We have a standard n-tier application with a WPF/MVVM client, WCF server, and MS SQL Database. Users can define their own interface, so the data needed from the WCF service changes based on what interface the user has defined for themselves Models are used on both the client-side and server-side for

Entity Framework Split Table Delete

ⅰ亾dé卋堺 提交于 2019-11-28 09:55:20
I'm using EF 4 STE's to model an Attachment object. The Attachment contains a Name, Description, Date, and most importantly Data ( byte[] ). To optimize loading, I don't want to retrieve the Data property until it's absolutely necessary, i.e. when the user clicks Download from the client. In an effort to follow this approach, I used the table-splitting technique described here . I split my Attachment table up into Attachment (Name, Description, Date) and AttachmentData (Data). It's a 1-to-1 relationship in my EF model. Everything works great until I try to delete an Attachment without the

Preventing StackOverflowException while serializing Entity Framework object graph into Json

两盒软妹~` 提交于 2019-11-27 21:42:11
I want to serialize an Entity Framework Self-Tracking Entities full object graph (parent + children in one to many relationships) into Json. For serializing I use ServiceStack.JsonSerializer . This is how my database looks like (for simplicity, I dropped all irrelevant fields): I fetch a full profile graph in this way: public Profile GetUserProfile(Guid userID) { using (var db = new AcmeEntities()) { return db.Profiles.Include("ProfileImages").Single(p => p.UserId == userId); } } The problem is that attempting to serialize it: Profile profile = GetUserProfile(userId); ServiceStack