Ever felt the need to log what your ECO persistence server is up to?
This page was created by Alexandra on 2018-10-26. Last edited by Edgar on 2025-08-31.
public partial class ModelPMP : Eco.Persistence.PersistenceMapperProvider
{
List<string> _log = new List<string>();
public ModelPMP() : base()
{
EcoListener.StartListening();
EcoLogSwitches.LogSql = true;
EcoListener.Singleton.OnTraceLog += new TraceLogHandler(OnTraceLog);
this.InitializeComponent();
}
private void OnTraceLog(object sender, TraceEventArgs e)
{
if (e.Category.Equals(EcoTraceCategories.Sql))
{
_log.Add(e.Message);
}
}
The code above is one way to do it.
To make an ExpressionHandle load all rows in as few batches as possible, do this:
IObjectList il=(ehPerson.Element as IObjectList); il.EnsureObjects();
