Using LLBLGen 4.0 Final, Self Servicing, .NET 4.5:
I'm upgrading my code to LLBLGen 4.0. As suggested by the documentation, I am trying to change all calls like entity.Fields[index].CurrentValue to entity.Fields.GetCurrentValue(index). In general this is working well, but there's one case I'm having trouble with.
I currently have a call like this:
var entity = GetMyEntity();
var index = 5;
var type = entity.Fields[index].ActualDotNetType;
I'd like to do this without accessing .Fields[index] to get better performance. However, there's no GetActualDotNetType() on IEntityFields or IEntityFieldsCore. I did find that I can do this:
entity.Fields.GetAsPersistenceInfoArray()[index].ActualDotNetType
but it appears that GetAsPersistenceInfoArray() is cloning the array before returning it, so it seems like there might not be much performance improvement in that method over my original code.
Is there an efficient way get get the ActualDotNetType for a field?