poco

Why did POCO chose to use Posix semaphores for OSX?

I am a new bee to MAC/OSX. I am working on Titanium a cross platform runtime, which uses POCO library for most of the portable C++ API. I see that POCO uses POSIX semaphore for its NamedMutex implementation on OSX as opposed to SysV semaphore that it is using for few other *NIX. bool NamedMutexImpl::tryLockImpl() { #if defined(sun) || ...

EntityFramework 4.0 POCO Proxy Problem

I see a lot of people asking a similar question, but not this exact one. I'm trying to do what I would hope would be relatively simple with POCO proxies. using (var context = new MyObjectContext()) { context.ContextOptions.ProxyCreationEnabled = true; // this does indeed create an instance of a proxy for me... // ...

ADO.Net Entity Framwork 4 CTP POCO Mappings Error

We are starting on a new version of our product and decided to use POCO objects with EF while keeping backwards compatibility with the existing databases. The problem is that i have a credit card object with a property BillingAddress that is of type Address. In the new database model all address are stored in the address table, in the ...

Caching POCO objects in Entity Framework 4.0

I have a database with a bunch of reference tables like States, Languages, etc.. I would like to be able to cache these tables and then use those types in any ObjectContext I want. So in pseudo code I want to be able to do something like this var db1 = new PatientObjectContext(); Cache.CacheStates(db1.States.ToList()) var person = new ...

How does MS Entity Framework map from the conceptual model to CLR types?

Hi, Given an Entity Data Model (EDMX) with "Code Generation Strategy" set to "None", how does EF determine which CLR types to map the conceptual model to? I think I read somewhere that it just probes the assembly for types that match the conceptual model, but that was in reference to a CTP edition of EF. Is this still the case? Can I...

Error creating POCO for Northwind db

I am trying to create POCO from Northwind db manually. I am getting error while I have created Order_Details class. System.Data.SqlClient.SqlException: Invalid object name 'dbo.Order_Detail'. Problem is that in northwind db [Order Details] table has a space inbetween it...How do I fix in creating POCO's TIA ...

LINQ to XML to POCO object

I've got an XML file that I want to turn in to a list of POCO objects. I have the following working code to read the XML and create objects from it. I just want to check this is a good way to do this and I'm not missing any tricks. In particular with regards to the nested Linq query. XDocument xmlDoc = XDocument.Load(path); var q = fr...

Cant convert poco object from EF 4 to JSON.

Im working on a mvc 2.0 application using the entity framework. With the entityframework I use the repository pattern with poco objects. To start off with the issue, when I convert an entity object to json I get a circular reference error. After some search I discovered that there are proxy's generated to support lazy loading. If there ...

POCOs, DTOs and IDataErrorInfo

Hi Everyone, I awake this morning to a problem! In all of my components, I have a set of Business Rules which are used to validate DTOs before any changes are committed to the repository. I've been trying to figure out the best way to get validation errors back to the UI and I came across the IDataErrorInfo interface. Fantastic! How...

POCO + Entity Framework with repository pattern - permission handling

Hello. I have an application that consists of 3 layers: UI: to be implemented in ASP.NET MVC Business: Holds the business logic and resource access control Repository (DAL): Implemented with POCO objects and EF, using the repository pattern. My POCO objects are shared with the upper layers. I have questions about what information/meth...

Poco: SQL select return no tuples. How do I detect that

I am using Poco C++ libraries for accessing the database. Following is a query from the Poco::Data docs ses << "INSERT INTO FORENAME VALUES(:name)", use(aName), now; Given an SQL select query if it returns no tuples how do I detect that? Is there a flag which is set by the data base? ...

EF 4 Feature CTP 4 - Associate Many to Many

I am using EF 4 Feature CTP 4. I have the following database schema: [Users] 1-M [UserRoles] M-1 [Roles] I have a User and Role class (both POCOs). When I try to associate an existing role to a user, a new record is getting inserted in the Roles table, instead of only inserting a new record in UserRoles. So say I have User 1 and wa...

Caching while loading objects from database in Entity Framework

Here is my simplest structure Customer CustomerID FirstName LastName ... BrokerID <- Navigation Property created with this FK Broker BrokerID FirstName LastName Now my question is, if I load multiple customers, and I want to see list of customer and I also need to see the Name of Broker associated with the cus...

Entity Framework 4 - How to Read Multiple Record Sets From A Stored Procedure?

Hi Guys, I have a very simple stored procedure which returns multiple record sets. All of the record sets have aliased columns so they all look the same. E.g. SELECT TOP 10 FooId AS Id, Name As Name FROM Foos SELECT TOP 10 BarId AS Id, Name As Name FROM Bars ... For my EF setup, i'm using POCOs and have my own DataC...

Entity Framework 4 and POCO

I'm trying to get started using the latest Entity Framework 4 release on Visual Studio 2010 to create a simple WCF application. I would really like to start using POCO objects as opposed to EntityObject classes to serialize. I have been looking for some good write-ups about how to implement custom POCO mappings for Entity Objects but can...

Building POCO (C++ lib) fails due to wrong Visual Studio Version

Hi there. I am trying to build the POCO C++ with Visual Studio 2010. As the developers don't offer a suitable solution for VS 10 yet, I used the conversion manager to convert a VS 9 solution. Unfortunately, building fails with the following error message: Error 2 error : 0x2 trying to open file . C:\Dokumente und Einstellungen\evn...

Create a entity data model mapping to pocos that exists in another assembly and different namespaces

I have the following layout in my project (quite simplified): Assembles App.WinClient <--- client App.Service.Api <--- Contains models/businessobjects and service interfaces App.Service <--- service implementation Namespaces I got the following namespace layout in App.Service.Api App.Users (contains User, IUserService etc) App....

Why should I use nhibernate instead of entity framework 4

I'm trying to convince my client to use nhibernate instead of Entity Framework 4. My client have decided to use only Microsoft libraries (including Unity and Enterprise library 5). I don't agree with them (there are so much better logging frameworks/validation layers/ioc etc) but respect their decision. I've played with EF4 for a couple...

How to declare one to one relationship using Entity Framework 4 Code First (POCO).

How to declare a one to one relationship using Entity Framework 4 Code First (POCO)? I found this question http://stackoverflow.com/questions/2089395/one-to-one-relationships-in-entity-framework-4-v2-with-poco, but the article that the answer references was not useful (there is one line of code that is a 1-1 relationship, but no mention...

Entity Framework - related ICollection getting materialized into HashSet

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 ICollecti...