Questions tagged [poco]

Means Plain Old CLR Object, a simple object that does not follow any object model, convention or framework. For questions about the POCO C++ library, please use [poco-libraries].

Means Plain Old CLR Object, a simple object that does not follow any object model, convention or framework. For questions about the POCO C++ library (http://pocoproject.org), please use [poco-libraries].

1553 questions
23
votes
1 answer

MVC3 App/Service Layer/Repository Layer/POCO Classes/EF4 - Questions!

I am new to this whole design concept, and in reading for the last few weeks I have gathered a lot of information, but it seems scattered and conflicted. Terms are mixed, and I am just having a hard time wrapping my mind around this. The pattern I…
Sam
  • 15,336
  • 25
  • 85
  • 148
23
votes
4 answers

OptimisticConcurrencyException Does Not Work in Entity Framework In Certain Situations

UPDATE (2010-12-21): Completely rewrote this question based on tests that I've been doing. Also, this used to be a POCO specific question, but it turns out that my question isn't necessarily POCO specific. I'm using Entity Framework and I've got a…
Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
23
votes
4 answers

EF4 Poco Issue Mapping Types Same Name Same Assembly Different Namespaces

I am experiencing an issue with EF4 and Proxy Pocos. I have 2 classes with the same name in the same assembly but different namespaces: QuoteModels.CashPayment OrderModels.CashPayment This compiles fine but at runtime EF throws the following…
Ken Burkhardt
  • 3,528
  • 6
  • 33
  • 45
23
votes
8 answers

"Metadata information not found" while using EF4's POCO Template?

I just installed the POCO Template for EF4. I have a single entity in my model, AnnouncementText, and the T4 files seem to be properly generated. Attempting to access this new entity is throwing the following error when I access the auto-generated…
ladenedge
  • 13,197
  • 11
  • 60
  • 117
23
votes
4 answers

prefixing DTO / POCOS - naming conventions?

simple question really, i was wanting to know what naming conventions anybody puts on there DTO / POCOS .... I didn't really want to prefix like hungarian notation.. i got away from that!. But my dtos naming are clashing with my actual returned…
mark smith
  • 20,637
  • 47
  • 135
  • 187
22
votes
3 answers

POCO's, DTO's, DLL's and Anaemic Domain Models

I was looking at the differences between POCO and DTO (It appears that POCO's are dto's with behaviour (methods?))and came across this article by Martin Fowler on the anaemic domain model. Through lack of understanding, I think I have created one…
dan
  • 5,664
  • 8
  • 45
  • 59
22
votes
4 answers

Extension Methods vs Instance Methods vs Static Class

I'm a little bit confused about the different ways to use methods to interact with objects in C#, particularly the major design differences and consequences between the following: Invoking an instance method Using a static class on a POCO Creating…
johnnyRose
  • 7,310
  • 17
  • 40
  • 61
21
votes
5 answers

Is there any reason to make POCOs into Model objects?

If I am generating POCO objects from EntityFramework, and using these to go to/from the WCF server, is there any reason to create client-side Models for the Views & ViewModels to use instead of just using the POCOs directly? Almost all the MVVM…
Rachel
  • 130,264
  • 66
  • 304
  • 490
20
votes
3 answers

Entity Framework 4.1 Code First Foreign Key Id's

I have two entities referenced one to many. When entity framework created the table it creates two foreign keys, one for the key I have specified with the fluent interface and the other for the ICollection. How do I get rid of the duplicate foreign…
Lukasz
  • 8,710
  • 12
  • 44
  • 72
19
votes
1 answer

EF POCO code only VS EF POCO with Entity Data Model

The ability to separate domain objects completely from any kind of persistance code makes systems much more extensible and maintainable. Testing is made much easier when business logic can be tested separately from storage code. The use of POCOs…
19
votes
2 answers

Entity Framework code first: How to ignore classes

This is similar to questions here and here, but those are old and have no good answers. Let's say I have the following classes: class HairCutStyle { public int ID { get; set; } public string Name { get; set; } } class…
Chris
  • 443
  • 1
  • 3
  • 14
18
votes
4 answers

Domain Entities, DTO, and View Models

I have an ASP.NET MVC 2 application with a POCO domain model and an NHibernate repository layer. My domain model has no awareness of my viewmodels so I use automapper to go from viewmodel to entity and vice/versa. When I introduced WCF to my…
Mayo
  • 10,544
  • 6
  • 45
  • 90
18
votes
5 answers

EF4 Cast DynamicProxies to underlying object

I'm using Entity Framework 4 with POCO template. I have a List where MyObject are dynamic proxies. I want to use the XmlSerializer to serialize this list, but I don't want them serialized as DynamicProxies but as the underlaying POCO object. I know…
petey
  • 183
  • 1
  • 1
  • 5
18
votes
3 answers

Entity Framework Eager Load Not Returning Data, Lazy Load Does

I'm using code first EF5 and I have an object which has a collection defined as virtual (lazy loaded). This returns data when called. However I want it to be eager loaded. I've removed virtual from the property signature but now it always returns…
Barry
  • 1,084
  • 1
  • 8
  • 22
18
votes
4 answers

How to statically link using link.exe

I've been trying to statically link against a C++ library called Poco on Windows using the Visual Studio 2008 command line tools. I build my program with: cl /I..\poco\lib /c myapp.cpp link /libpath:..\poco\lib myapp.obj PocoNet.lib This results in…
Yang
  • 16,037
  • 15
  • 100
  • 142