poco

Entity Framework 4 relationship management in POCO Templates - More lazy than FixupCollection?

I've been taking a look at EF4 POCO templates in beta 2. The FixupCollection looks fine for maintaining the model correctness after updating the relationship collection property (i.e. product.Orders it would set the order.Product reference ). But what about support for handling the scenario when some of those Order objects are remove...

NHibernate: bidirectional many-to-one problem

I have a bidirectional relationship in NHibernate: <class name="Child" table="Children"> <many-to-one name="Parent" column="ParentId" not-null="true" /> </class> <class name="Parent"> <set name="Children" lazy="true" table="Children" cascade="all"> <key column="ParentId" not-null="true" /> <one-to-many class="Child" /> </...

Entity Framework and Modeling Collections with an Interface as a return type

I am using Entity Framework v4. I have created a POCO class that contains a bunch of scalar properties and a collection that returns an Interface type. How do I create this relationship in the EF model? How do I show a collection that contains different items but they all have a common interface? Here would be an example of what I a...

System.Windows.Ria.Controls and POCO

I'm trying to figure out how to use POCO for silverlight use. I found an article that appears it will step me through the basics. However, it has in it a reference to the System.Windows.Ria.Controls. i don't have that on my machine.. i found System.Windows.Ria but not one that has teh control on it. I just downloaded teh RIA beta to...

Load XML file into object. Best method?

Hello, We are receiving an XML file from our client. I want to load the data from this file into a class, but am unsure about which way to go about it. I have an XSD to defining what is expected in the XML file, so therefore i can easily validate the XML file. Can i use the XSD file to load the data into a POCO, using some sort of ser...

Is there a good comparison of the different Entity Framework 2.0 code generators?

Inspired by this post, I'm wondering if anyone has found a good comparison between the POCO Generator and the 1.0esque Entities/Context. Why should I use one over the other? Or, what criteria should I be evaluating on my project to make my decision? I once thought that POCO's were less work for mvc/wcf/databinding. But it seems a mor...

How to define a collection in a POCO in Entity Framework 4?

Lets say I've a Team class which contains 0 or more Players. The Player class is easy: public class Player { public long Id { get; set; } public string Name { get; set; } public Team Team { get; set; } } But whats the best to define the Team class? Option 1 public class Team { public long Id { get; set; } public...

Tracking changes in Entity Framework 4.0 using POCO Dynamic Proxies across multiple data contexts.

I started messing with EF 4.0 because I am curious about the POCO possibilities... I wanted to simulate disconnected web environment and wrote the following code to simulate this: Save a test object in the database. Retrieve the test object Dispose of the DataContext associated with the test object I used to retrieve it Update the test...

Does Poco C++ library have a cross platform WaitForMultipleObjects() analog?

Based on this question I am going to use Poco::NamedEvent, but I need to wait for multiple events (like win32 WaitForMultipleObjects() Is there such a thing in poco? (searching the docs doesn't yield much but perhaps I am not using the right searches) ...

Convert a custom config class into POCO

Given a set custom configuration classes based off ConfigurationElement I want to convert the custom class into a POCO object graph. Could reflection and LINQ extension methods/ anonymous types give me an object which removes the ConfigurationElement inheritance? ...

POCO Build Problem

Hello, I'm trying to try the POCO library. I downloaded the zip file, and opened the vs solution file named "Net_vs90.sln" on VS 2008. When I try to build the solution, I get this ugly error: bla bla bla.... 1>Linking... 1>LINK : fatal error LNK1104: cannot open file 'PocoFoundationd.lib' bla bla bla.... Linkin...

what is Entity Framework with POCO

What is the benefit of using POCO? I don't understand the meaning of Persistence Ignorance, what does this mean? That the poco object can't expose things like Save? I can't wrap my head around this POCO that there's alot of buzz around. What is the difference with the EF generated entities and POCO? ...

Are EntityFramework generated Entity Persistence Ignorance

So I'm starting to look into EF and POCO. From my understanding, the entity generated by EF is not pure POCO since it inherit from EntityObject. But are they PI? It seem to me that they don't have any persistence awareness in them, or there is something in the EntityObject that makes them PI? ...

Socket select() Handling Abrupt Disconnections

I am currently trying to fix a bug in a proxy server I have written relating to the socket select() call. I am using the Poco C++ libraries (using SocketReactor) and the issue is actually in the Poco code which may be a bug but I have yet to receive any confirmation of this from them. What is happening is whenever a connection abruptly ...

Entity Framework 4.0 Autogenerated Classes not marked as Serializable

Hi, 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...

MVC 2 Validation and Entity framework

I have searched like a fool but does not get much smarter for it.. In my project I use Entity Framework 4 and own PoCo classes and I want to use DataAnnotations for validation. No problem there, is how much any time on the Internet about how I do it. However, I feel that it´s best to have my validation in ViewModels instead and not let ...

Entity Framework 4 and Public Properties

I am working on a project and I am using Entity Framework 4 as my ORM. I am implementing POCO classes. Every example I see with EF 4 and POCOs implements all properties with public setters. Is that the only way I can use POCO classes with EF 4? Do all my setters need to be public? ...

Using Data Annotations on POCO's with MVC for Remote Validation

Hi All, I am developing an ASP.NET MVC app and I've been looking into using Data Annotations on my POCO's which are defined in my Service Layer. As long as I have a reference to System.ComponentModel & System.ComponentModel.DataAnnotations this is no problem and what I like about this is that it allows me to reuse my Service Layer in a ...

Sockets: I/O Error 32

Could someone please explain what an I/O Error 32 refers to in the context of a network socket? I have a multithreaded Socks5 server written using Poco SocketReactors and am getting this error when the server load reaches a certain point. The exception is thrown within my onReadable handlers at the same time across all threads which hav...

Entity Framework's object graph & Repository Pattern

The repository pattern typically has Get*() and Save() (or equivalent) methods for each object. How does this fit into the object graph in EF? Consider the following with lazy-loading POCO objects: // EF var orderItems = context.OrderItems.Where(oi => oi.Order.Id == 123); // Repository IOrderItemsRepository orderItemsRepository = new...