We need to re-archaect part of the project considering the a multitude of attributes that are needed when objects get transported and saved to a database…
My question is: Is there anything stopping us from building a capability like whats found in EntityFramework.
Why are you using #define’s to exclude attributes, why don’t you just leave them always defined?
ServiceStack Attributes relies on the implementation and dependency-free ServiceStack.Interfaces project which should the the only project your models and DTOs need to reference.
Attributes are typically a compile-time metadata construct so you’re normally not going to be able to add the fluently like this, but ServiceStack does provide an API to add them dynamically, so you should be able to do something like:
This is unique to ServiceStack, other libraries may not offer a way to add attributes dynamically. Is there a reason why you can’t just include both, e.g:
[Index, Indexed]
public string UserAccountId { get; set; }