Using SimpleDB (with SimpleSavant) with POCO / existing entities, not attributes on my classes
Posted
by alex
on Stack Overflow
See other posts from Stack Overflow
or by alex
Published on 2010-02-24T20:59:09Z
Indexed on
2010/05/02
21:58 UTC
Read the original article
Hit count: 168
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?
© Stack Overflow or respective owner