Hi guys,
I use adapter on a CF application and I want to add a custom property that will result from a collection of other entities. Something like this:
public int CurrentMileage
{
get
{
.............
EntityCollection<VehicleMileageEntity> controles = new EntityCollection<VehicleMileageEntity>();
RelationPredicateBucket bucket = new RelationPredicateBucket();
IPredicateExpression filter = new PredicateExpression();
filter.Add(VehicleMileageFields.VehicleId == this.VehicleId);
//IPrefetchPath2 prefech = new PrefetchPath2((int)EntityType.ControlesEntity);
//prefech.Add(ControlesEntity.PrefetchPathMeasurements);
// SortClause sort = new SortClause(ControlesFields.DateCreated, SortOperator.Descending);
SortExpression sortExp = new SortExpression();
sortExp.Add(VehicleMileageFields.DateCreated | SortOperator.Descending);
** //DataAccessAdapter _adapter = null;
//try
//{
// _adapter = new DataAccessAdapter(Config.Instance.ConnectionString, true);
// _adapter.OpenConnection();
// _adapter.FetchEntityCollection(controles, bucket, 1, sortExp, prefech);
//}**
//catch (Exception ex)
//{
// Logger.LogException(ex);
//}
......
}
}
}
The problem is that the DataAccessAdapter cannot be access in this project (it is located in the DataLayetDbSpecific project). Is there another way to accomplish this with adapter and CF?
Thanks