I have a framework with objects and data access code. This objects are mapped to the database using NHibernate.
For example my framework has class Customer and Order:
public class Customer
{
private Guid _id;
private string _name;
private IList<Order> _orders;
public properties...
}
public class Order
{
private Guid _id;
private string _orderNumber;
public properties...
}
I also have a WCF service with a method PersistCustomer. Like so:
[ServiceContract]
public interface ICustomerService
{
[OperationContract]
void PersistCustomer(Customer customer);
}
This WCF have a reference to my framework library.
I've created a client app for the WCF service (a simple console app) and it works!
The main thing i couldn't understand: why does it work without decorating my classes in the framework as DataContract and their properties as DataMembers? And should i decorate them?
Thanks