I am pondering over my previous question and was wondering whether a POCO class can have a member of Entity Object type that can be accessed from client via RIA service.
public class CompositeData
{
[Key]
public Guid PKey { get; set; }
public string CompositeName { get; set; }
public string Identity { get; set; }
public Product CurrentProduct { get; set; } //Product is an auto-generated EntityObject class
public CompositeData()
{
PKey = Guid.NewGuid();
}
}
Erm – if your POCO class had a member that was of type EntityObject then it wouldn’t be a POCO class anymore. The point of POCOs is to abstract away the references to enitity framework for things like testing. POCOs being ‘plain old CLR objects’ wouldn’t be very plain with an EntityObject type in there.
You can use straight (geninue) POCO objects with RIA services though as this article demonstrates.