Hello,
i decided to give you exta information about my issue.
First, as i wrote earlier, i am using Dependency injection on my service.
My auditor class look like:
[DependencyInjectionInfo(typeof(IEntity2), "AuditorToUse")]
[Serializable]
public class GeneralAuditor : AuditorBase
{
.........
}
When i am updating entity, i found that, for example, CfrcManufacturerEntity does not write log for method
/// <summary>CTor </summary>
public GeneralAuditor()
{
_auditInfoEntities = new List<AuditInfoEntity>();
// clear temporal audit stream
_auditInfoSW = new StringWriter();
_outputAuditFileName = "D:\Projects\CfrCoupons\Server\dev\Attachments\noraudit.txt";
}
/// <summary>
/// Audits when an entity field is set succesfully to a new value.
/// </summary>
/// <param name="entity">The entity a field was set to a new value.</param>
/// <param name="fieldIndex">Index of the field which got a new value.</param>
/// <param name="originalValue">The original value of the field with the index passed in
/// before it received a new value.</param>
public override void AuditEntityFieldSet(IEntityCore entity, int fieldIndex, object originalValue)
{
StringWriter sw = new StringWriter();
sw.WriteLine("AuditEntityFieldSet, entity - {0}", entity.GetType());
AddAuditRecordStringToBulkStream(sw.ToString());
// avoid to audit into AuditInfoEntity (this would create an overflow effect). This is necessary if this auditor is injected into
// all entities, thus also in the AuditInfoEntity
if (entity is AuditInfoEntity)
{
return;
}
if (((IEntity2)entity).Fields[fieldIndex].Name == "AppSettings")
return;
// used to store the change experimented by a field.
string originalValueAsString = string.Empty;
string currentValue = string.Empty;
// sets VALUE OR NULL for originalValue and uses it as string.
if (originalValue != null)
{
originalValueAsString = originalValue.ToString();
}
else
{
originalValueAsString = "NULL";
}
// sets VALUE OR NULL for currentValue and uses it as string.
if (entity.GetCurrentFieldValue(fieldIndex) != null)
{
currentValue = entity.GetCurrentFieldValue(fieldIndex).ToString();
}
else
{
currentValue = "NULL";
}
// construct audit info record
StringWriter auditInfo = ConstructAuditRecord(entity.LLBLGenProEntityName,
AuditType.EntityFieldSet,
string.Format("{0}. FieldSet: {1}. OriginalValue: {2}. CurrentValue: {3}",
GetPrimaryKeyInfoFromEntity(entity),
((IEntity2)entity).Fields[fieldIndex].Name,
originalValueAsString, currentValue), entity);
// add to later-persist list
AddAuditRecordStringToBulkStream(auditInfo.GetStringBuilder().ToString());
}
This is my generated code for CfrcManufacturerEntity:
<Snip>
I tried to look through all topics about common issue, read online documentation but i have not got to the point of my case.
Please, help me with it.