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

1502 questions
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
  • 12,165
  • 10
  • 56
  • 106
23
votes
1 answer

What is the proper data annotation to format my decimal property?

I have a POCO with a decimal property called SizeUS. I would like to use data annotations to format the display of the decimal in a view. My SizeUS property is only displaying 2 decimal places in my view and I want it to display 4 decimal places. …
Bill Greer
  • 2,734
  • 6
  • 39
  • 66
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
  • 19,527
  • 44
  • 131
  • 185
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,386
  • 7
  • 42
  • 54
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
  • 122,023
  • 59
  • 287
  • 465
19
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,382
  • 11
  • 42
  • 69
19
votes
0 answers

Known reasons why sqlite3_open_v2 can take over 60s on windows?

I will start with TL;DR version as this may be enough for some of you: We are trying to investigate an issue that we see in diagnostic data of our C++ product. The issue was pinpointed to be caused by timeout on sqlite3_open_v2 which supposedly…
Yester
  • 533
  • 5
  • 17
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

Custom setter for C# model

I don't know how to make custom setter for C# data model. The scenario is pretty simple, I want my password to be automatically encrypted with SHA256 function. SHA256 function works very well (I've used in in gazillion of projects before). I've…
Stan
  • 22,856
  • 45
  • 148
  • 231
19
votes
5 answers

Gave up DDD, but need some of its benefits

I'm giving up traditional DDD, which is often a massive timewaster, and forces me to do endless mapping: data layer <--> domain layer <--> presentation layer. For even a small change I must change data models, domain models, presentation models /…
Bobby B
  • 2,237
  • 2
  • 19
  • 46
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
  • 9,758
  • 6
  • 40
  • 89
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
  • 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,064
  • 1
  • 7
  • 21
17
votes
6 answers

Data Binding POCO Properties

Are there any data binding frameworks (BCL or otherwise) that allow binding between any two CLR properties that implement INotifyPropertyChanged and INotifyCollectionChanged? It seems to be it should be possible to do something like this: var…
Kent Boogaart
  • 165,446
  • 34
  • 376
  • 376
17
votes
7 answers

MVC 3 - How is this ever going to work?

I have made this post over a year ago, and I think it makes sense to update it as it's getting quite a few views. I'm either missing something out or Microsoft has really messed up MVC. I worked on Java MVC projects and they were clean and simple.…
user338195