How i can construct object from audit data? #411
Replies: 7 comments
-
I guess you are referring to querying past audit events that you saved with a data provider. It depends on the data provider, some of them provides |
Beta Was this translation helpful? Give feedback.
-
No, for example: i have:
How can I construct my Entity from this data at the time I need? |
Beta Was this translation helpful? Give feedback.
-
Where do you have the JSON you shared, in a file? And what is your Entity, a .NET object? Please share the context otherwise I cannot help |
Beta Was this translation helpful? Give feedback.
-
I connected Audit.Net Entity Framework and this Files automaticaly created and I had records in database with audit data.
can i get from this files or database data my Entity "FORM" from table "FORMS" at a certain point in time? |
Beta Was this translation helpful? Give feedback.
-
for example: and I need to get what the form looked like at 11:00 |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if you can construct a query like that. You can't really know the history of an entity just by looking at the client changes. Unless every DB action is audited, and even then it will be difficult to know, since you must look back for the latest change of every column, etc. But that really depends on the data provider you use, or how you store the audit event info. I guess you didn't configure any data provider and it's using the default which is a FileDataProvider that stores the events as JSON files on the current directory. I don't think storing the events in files will help you with that task. If you need to do such queries you should probably use the SqlServerDataProvider or the EntityFramerowkDataProvider to store the data in a database that you can query. |
Beta Was this translation helpful? Give feedback.
-
Also check the IncludeEntityObjects setting, that could help since it will store the complete entity graph that is currently being tracked |
Beta Was this translation helpful? Give feedback.
-
Hellow. Hello, is it possible to construct an object at a certain point in time based on audit data? I looked for it in your documentation, but I didn't find it. If this library does not have such a feature, can you tell me how to do it.
Beta Was this translation helpful? Give feedback.
All reactions