Ever felt the need to log what your ECO persistence server is up to?
(Blanked the page)
No edit summary
Line 1: Line 1:
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 make an ExpressionHandle actually load all rows in as few batches as possible go like this:
IObjectList il=(ehPerson.Element as IObjectList);
il.EnsureObjects();

Revision as of 18:17, 26 October 2018

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 make an ExpressionHandle actually load all rows in as few batches as possible go like this:

IObjectList il=(ehPerson.Element as IObjectList);
il.EnsureObjects();
This page was edited 90 days ago on 02/10/2024. What links here