poco

How can I dynamically customize a POCO proxy in EF 4?

╄→гoц情女王★ 提交于 2019-12-13 00:28:33
问题 I would like to dynamically customize some POCO classes overriding myself the virtual members to be able to compile LINQ to Entities queries. I know about the ObjectMaterialized event but that happens after the class instantiation. I would like to be able to create the proxy myself, override the virtual members I want and then pass along to the EF, is that possible? Imagine the following POCO class: public class Consumer { /* That´s a virtual property with an association in EF */ public

Entity Framework 4.0 Autogenerated Classes not marked as Serializable

爷,独闯天下 提交于 2019-12-12 13:45:24
问题 One strange thing i've got to see in Entity Framework 4.0 V2 Auto Generated Classes(tt) is that the classes are not marked as Serializable. Although they are having DataContract attribute for WCF. Now the problem is, when I store the POCO object into viewstate it throws me an exception saying that the class is not serializable. If I generate the classes without the t4 templates or using the defualt class generating scheme, what i see is that the generated classes are having the Serializable

Poco AsyncChannel does not exit on forked process exit

馋奶兔 提交于 2019-12-12 04:53:45
问题 Problem: Call/Initialize Poco code from inside a C library, using loader (3rd party C program, our code is in c++). The Program loads our library, our lib initializes Poco::Logger and uses AsyncChannel + FileChannel in the logger. Fork from this process. Run some threads in the child process. try to exit the child process, joining threads. The AsyncChannel's destructor blocks on close(), essentially polling Queue and sleeping. The _queue has 1 element always when the destructor for

Changing EF Model and creating new entities in runtime

若如初见. 提交于 2019-12-12 02:57:54
问题 I'm using EF4 in model (DB First), POCO in entities, ASP.Net in UI. I have a Biz layer of course. I need to design dynamic form generator. I decide to create a table from forms design by users, and then update my EF model in runtime, generate POCO objects and biz logic in runtime, and then compile them in runtime. I have problem about updating model in runtime. any help? Thanks in advance -Hamid 回答1: EF is not tool for your problem! EF is build around simple concept - mapping and classes are

how to include stored procedures with Entity Framework Reverse POCO Generator version 2.14.3

只谈情不闲聊 提交于 2019-12-12 02:14:45
问题 I am using the Entity Framework Reverse POCO Generator version 2.14.3 and I would like to include only stored procedures with name starts "usp_CMT_update*" in Apps schema. I used default settings for stored proocedure in the .tt file but only some of them were generated. I also tried regex pattern but still didn't get the stored proc generated. Please help. Thanks. // Stored Procedures ***************************************************** // Use the following regex filters to include or

POCO entity-based RIA service can't de-serialize associated entities

╄→гoц情女王★ 提交于 2019-12-12 01:35:32
问题 I'm developing a Silverlight Business Application, using a RIA service, which is returning POCO entities (TaskTime and User). The TaskTime entity has a User entity associated with it. I have created a domain service which has a query function (GetTimesheet) which returns an IQueryable collection of TaskTime entities, which works fine if I don't try and get the associated User entities as well, but as soon as I include the [Include] and [Association] attributes above the 'User' property in the

Silverlight & RIA & POCO: SubmitOperationFailed when INSERTING two new child entities. An entity with the same ID exists

末鹿安然 提交于 2019-12-12 01:34:35
问题 Here's my scenario: I am using Silverlight, RIA and POCO objects (no Entity Framework; we're working against Oracle and SP's). I have a Parent object that contains a collection of Child objects. I have setup the Association and Composition attributes on the Parent correctly. When I want to save changes, the entire object graph gets sent to the server correctly. The user can add one or more Child objects to the Parent. Now, if the user adds ONE Child object to the Parent and saves it then

Why does adding a child element to my entity framework try and insert a new parent?

两盒软妹~` 提交于 2019-12-12 00:43:27
问题 I have a C# REST Service in WCF that sits on top of an EF 4.2 framework on SQL 2008. There are a few entities, but the two that matter are Trips and their children, PlacesOfInterest. Here are the tables: -- Creating table 'Trips' CREATE TABLE [dbo].[Trips] ( [Id] uniqueidentifier NOT NULL, [Name] nvarchar(max) NOT NULL, [ArrivalDate] datetime NULL, [DepartureDate] datetime NULL, [WhereTo] nvarchar(max) NOT NULL, [CreatedDate] datetime NULL, [UpdatedDate] datetime NULL, [Album] nvarchar(max)

Can a Entity Framework Trackable collection be bound to an ASP.Net Gridview?

故事扮演 提交于 2019-12-11 23:55:56
问题 I've got a GridView on a ASP.Net page. I would like to set the DataSource of the Gridview to a trackable collection of Entity Framework objects. I though the code should look like this: this.gvMyGridView.DataSource = entity.MyDetailedItems; this.gvMyGridView.DataBind(); But this doesn't display any data. I am using self tracking entities and the MyDetailedItems is a navigation property to rows from another table. 回答1: EF 4 with self tracking entities does not support lazy loading so you must

nhibernate many to many with multiple table

柔情痞子 提交于 2019-12-11 20:25:54
问题 Good morning, I have the following schemas in mind which the login as describe below image. Normally, the association table would contain the Key of table Position, Division, and Qualification. I am not sure whether this schema is well form or not.If it does could you please guide me how to represent it in Nhibernate XML schemas and PoCo class? Best regards, Veasna 回答1: Your schema, your ideas, are prove of concept: do not use many-to-many mapping. Chapter 24. Best Practices Don't use exotic