tags:

views:

6

answers:

0

I am creating an applikation which shall run on different platform (pc, protable, web). The Basic data structure in this application is allways the same but as an asp site I would like to use an sql server data base, on portable device XML and on PC may be an acess data base.

There for I created a basic data layer like the folowing Person class. This data layer should not be changed, but the structure (data types, relationships and so on) should be used in all kinds of persistent data storage.

This is very easy for XML because I only have to use the corresponding serializer but I have no idea how to generate an acess data structure out of my classes.

Classes:

public class Person
{
    public string Name{get; set;}
    public DateTime Birthday{get;set;}
}


public class House
{
    public string Adress{get; set;}
    public Person Owner{get; set;}
}

Data base structure:

Table Person

ID  |  Name   | Birthday
1   |  Hans   | 02.03.1955
2   |  Peter  | 01.04.1960

Table House

ID  | Owner | Adress
1   |   1   | Elmstreet 14
2   |   2   | Main Square 55

I know that the entity framework can such things in the other direction but realy need it this way. I am not