When to use TableController <T> and when to use Custom DomainManager
I'm trying to figure out when it makes sense to have my own domain manager. I initially claimed that whenever we had a return type that was not type Tin TableController<T>, we needed to create a new Custom DomainManager.
However, in the app Sport by Xamarin sample, their controller inherits from TableController<Athlete>, but their GET method returnsIQueryable<AthleteDto>
public IQueryable<AthleteDto> GetAllAthletes()
{
return ...;
}
NOTE: AthleteDtoinherits fromEntityData
If allowed, then why should I have trouble creating a new DomainManager?
I only need to create a new DomainManager if my return value is not inherited from EntityData?
You need to create a new DomainManager for each type of data source that you are connecting to. For example, there is a built-in domain manager for Azure table storage and one for Azure SQL using the Entity Framework.
Your data types must inherit from EntityDataor implement an interface ITableDatain order to use TableController<T>. It does not depend on the question of the domain manager.
, , , . , DTO, . , Athlete AthleteDto EntityData, AthleteBase.