Full Audit trail solution updated to LightSwitch 2012.
I updated my audit trail solution (http://blog.pragmaswitch.com/?p=291) to the latest visual studio 2012.
That didn’t take that much time. Solution upgrades from LightSwitch V1 to 2012 are very comfortable.
The most important functional change for the audit solution is a side-effect of the introduction of the technical RowVersion field in each table. It’s better to exclude this field from the auditing.
You can find the sample solution here: LS2012.AuditTrail
Drop me a line, in case of trouble.


[...] Full Audit trail solution updated to LightSwitch 2012 [...]
I have been trying to incorporate your audit solution into my project. My project is written in Visual Basic (VS Lightswitch 2012).
When I insert/modify tables, I get the correct entries in the audit table. With the correct entity details and id.
But the Function GetEntityByKey which is used to bring up the original entity details for the audit you are looking at when you press SHOW, is causing an issue.
Private Shared Function GetEntityByKey(dataService As IDataService, entitySetName As String, ParamArray keySegments As Object()) As IEntityObject
Dim singleOrDefaultQuery As ICreateQueryMethod = TryCast(dataService.Details.Methods(entitySetName + “_SingleOrDefault”), ICreateQueryMethod)
If singleOrDefaultQuery Is Nothing Then
Throw New ArgumentException(“An EntitySet SingleOfDefault query does not exist for the specified EntitySet.”, entitySetName)
End If
Dim singleOrDefaultQueryInvocation As ICreateQueryMethodInvocation = singleOrDefaultQuery.CreateInvocation(keySegments)
Return TryCast(singleOrDefaultQueryInvocation.Execute(), IEntityObject)
End Function
The only error I get when I build the application is the following:
Default property access is ambiguous between the inherited interface members ‘Public ReadOnly Default Property Item (name as String) As T’ of interface ‘Microsoft.Lightswitch.Details.IDetailsSet(Of.Microsoft.Lightswitch.Details.IDataServiceMethod)’ and ‘Public ReadOnly Default Property Item (name As String) As Microsoft.LightSwitch..Details.IDetailsWithName’ of interface ‘Microsoft.LightSwitch.Details.IDetailsSet’.
I have tried so many different things to get this to work with no luck.
I would most sincerely appreciate any help you could give me….
Many thanks.