Using SimpleDB (with SimpleSavant) with POCO / existing entities, not attributes on my classes
- by alex
I'm trying to use Simple Savant within my application, to use SimpleDB
I currently have (for example)
public class Person
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public DateTime DateOfBirth { get; set; }
}
To use this with Simple Savant, i'd have to put attributes above the class declaration, and property - [DomainName("Person")] above the class, and [ItemName] above the Id property.
I have all my entities in a seperate assembly.
I also have my Data access classes an a seperate assembly, and a class factory selects, based on config, the IRepository (in this case, IRepository
I want to be able to use my existing simple class - without having attributes on the properties etc..
In case I switch out of simple db, to something else - then I only need to create a different implementation of IRepository.
Should I create a "DTO" type class to map the two together?
Is there a better way?