poco

Are code generators bad?

I use MyGeneration along with nHibernate to create the basic POCO objects and XML mapping files. I have heard some people say they think code generators are not a good idea. What is the current best thinking? Is it just that code generation is bad when it generates thousands of lines of not understandable code? ...

Does a Poco to DataSet project exist?

I have a POCO object that goes 4 levels deep contained objects (like Invoice has line items that have taxes that have gl entries), and I want to turn the entire thing into a DataSet. So there would be 4 tables, each with constraints being applied to the parent table. Does anyone know of something that would automated this? ...

Define 'poco'?

Can someone define what exactly 'poco' means? I've encountering the term more and more often and I'm wondering is it only about plain classes or it mean something more? ...

Help needed for LINQ To SQL operations (insert/update) with nested POCO's

Ok well I've been trying to convert my model to use LINQ but didn't want to throw away my current DTO's and their interfaces which are scattered through the domain. I managed to find this blog post which has outlined the process quite nicely: Achieving POCOs in LINQ To SQL I have the managed to get the retrieval of records to objects ...

What constitutes a rich domain model in a POJO/POCO?

What is the difference between A simple fields-accesors-mutators class A rich-modeled class What constitutes rich modeling in business-domain classes? ...

How to unit test (in memory) entity framework?

As in the topic... I was thinking about something like "in memory changes". On recent blogs by Jaroslaw Kowalski i have found similar approach but i was thinking about sth much simpler ...

How should I structure a simple ASP.NET MVC app?

I've been reading a few things about ASP.NET MVC, SOLID and so on, and I am trying to figure out a simple "recipe" for small-to-medium ASP.NET MVC apps that would put these concepts together; the issue that I am most concerned with is ending up with controllers that are too complex and being like code-behind files in webforms, with all t...

How do i populate a POCO (child) IList property from a Linq2Sql query?

Hi folks, I have a two classes: public class Question { public IList<Answer> Answers { get; set; } } public class Answer { .. } In my Linq2Sql designer, there's two L2S objects on designer, with the correct 0<->many arrow between them. Kewl. I'm not sure how i can retrieve these questions/answers in a single call and populate m...

How can we get DynamicData working with EFPocoAdapter?

My team is hoping to use the EFPocoAdapter, but are also hoping to use the DynamicData tools with it but are having some issues. We basically added a "Dynamic Data Entities Web Application" project to the EFPocoAdapter Northwind sample solution (I am using the latest version, 1.03), referenced the needed assemblies and then uncommented ...

POCO C++ libraries on CDT

I am working with CDT (C/C++ for eclipse) on windows, and I need to start using POCO C++ libraries The current package distribution for POCO requires MS Visual Studio 7/8/9 for compiling the libs. Does anyone know a solution for compiling in a CDT environment on windows? I am using MinGW for compile/build tools. ...

Mitigating double mapping model overhead

After too much thought, I've decided to use Linq To SQL as a DAL for my project, but keep the business objects as POCO objects. This will give some flexibility because the database schema is old and have some problems that can not be solved, because backward compatibility. I'm thinking about making some methods to retrieve or complete ...

Bind POCO to UserControl

Hi I am in the process of writing my first .net gui. I am wondering if there is some specific way I need to apply to my poco objects for them to be bindable to a usercontrol. I have a few objects but I seem to be unable to bind them to my usercontrol. I read somewhere that they need to implement IBindable but I can't shake the feeling ...

Are LINQ generated classes POCOs?

Are the classes generated by LINQ (DBML) considered POCOs? If I add static queries to these classes, are they still POCOs? I imagine it changes once I start doing business things in the LINQ partials. Such as adding other attributes, creating collections and basically making the partials more than DAL classes. If the LINQ classes ar...

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 binding = new Binding(); binding.Source = someSourceObject; binding.SourcePath = "Customer.Name...

What is the best practice when implementing a data transfer object or POCO ? How should your POCOs look like ?

Which of the following is the best way to implement a poco? Option 1: public class PocoOption1 { public PocoOption1(int val1,string val2) { Val1=val1; Val2=val2; } public int Val1{get;private set;} public int Val2{get;private set;} } Option 2: public class PocoOption2 { public int Val1{get;set;} public ...

How do you make one generic select method for your DAL ?

Scenario You have an Assembly for Data Transfer Objects containing 10 classes that exactly represent 10 tables in your database. You generate / build a DAL layer that has methods like - DTOForTable1[] GetDataFromTable1(); DTOForTable2[] GetDataFromTable2(); and so on.... Question How do I make a method that hides the numerous...

.NET implementation of Portable Contacts API

Google just released a java implementation (jpoco). Is there a .NET one? Anyone planning on writing one? ...

Return plain objects in entity framework for serialization

I have been trying out both Linq to Sql and EF in my ASP.NET MVC application. After switching to EF I realized my XML/JSON serialization output has extra cruft. XML: <Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <EntityKey> <EntitySetName>Persons</EntitySetName> <...

POCO vs DTO

POCO = Plain Old CLR (or better: Class) Object DTO = Data Transfer Object In this post there is a difference, but frankly most of the blogs I read describe POCO in the way DTO is defined: DTOs are simple data containers used for moving data between the layers of an application. Are POCO and DTO the same thing? (ps: look at this great...

C#: Webservice changes expected parameter type (from a normal POCO to a an autogenerated class)

I have the following class in Class Library: Artist, which is a POCO Now I have a method in a web-service (which has a reference to the mentioned-above library) with a signature like this: [WebMethod] public int Artist_AddArtist(Artist a) { // } When I try to consume this service from an application (that also has a reference to the...