Комментарии:
How would you update in this approach if the interface has a user update field?
ОтветитьGood video, many thanks
ОтветитьCan the interceptor have a Principal in orher to obtain curren claims of user?
ОтветитьGreat thanks a lot
ОтветитьSorry I couldnt get how you saved this audit in database, if you saved for exemple “old values” and “new values”
ОтветитьDid you share the full code of this project ? I want to learn clean arc. From it
ОтветитьHi Milan, something I'd like to understand is where would that information (CreatedOnUtc, ModifiedOnUtic) be stored. Would it be stored on a separate table in the database?
ОтветитьVS theme please?
Ответитьgreat video! funny note, it looks like you edited out all of your blinks lmao
ОтветитьWhy using « entre.Proprety.(e => e.dummyField).CurrentValue » ? I never really think about and always used « entry.Entity.dummyField ». Does it make any difference ?
ОтветитьMilan, thanks for the awesome videos. What if you wanted to track the table columns affected, their previous values before CRUD and the new values after CRUD?
Ответитьa quick reminder from the case I encountered, there are two methods looks very similar in SaveChangesInterceptor, one is called SavingChangesAsync and one is call SavedChangesAsync, in thevideo we are implementing SavingChangesAsync. sometimes your IDE will aurocomplete to the other one. make sure you are overriding the correct method otherwise it won't work
ОтветитьThere is 'Entity' property on EntityEntry through which you can access properties directly. Also the described method won't work if we want to keep track of IDs generated by the database on insert.
ОтветитьVery useful video, thanks very much!
ОтветитьExcellent, thank you
ОтветитьDo you have a video on how you set up your visual studio? I love the way your Intellisense looks, and your color scheme. It looks like default with just a few nice modifications.
ОтветитьThanks Milan for your awesome video 👍
Is there a relation between Notification "e.g: like what SignalR do" and CQRS?
if yes, I hope you explain it in one of your upcoming videos
if no, I hope you also explain how to use it
This is populating some audit fields but you still only have the latest state of the entity. There is no capture here of the values that were changed. Yes, I know when a change was made, and you can also include the user to know who changed it. But you don't know what was changed. This may be fine for some use cases.
One option to get a real audit log with changes is to use TemporalTables if you are in SQL server.
Or, if you really want a more robust method take a look at the EventSourcing pattern.
Would this slow down your performance of the application?
ОтветитьI thought you are tracking who made what changes with the dates.
Like when user add or delete anything entities get audited along with user info
Milan, is it possible to capture here the ID of the person who made the modification or creation to save not only the date but also who made the transaction?
ОтветитьI can do all this in the context file without register any services. Which one is better?
ОтветитьHi Milan,
Thanks for this.
is their any major performance impact if we follow this method for auditing or any other better way ?
Hey Milan, great video. I have already implemented this kind of audit using EFCore, but I have found one setback in this. If you have related entities in your model, and for some reason it happens that the related entities are modified, then this way of audit will not work because EFCore change tracker doesn't track related entities (as per my experience). Have you found a workaround on this ?
ОтветитьUsing this implementation only last modified date will be written in db?
ОтветитьI see .net video, I like
ОтветитьWhat if you need to use the base SaveChanges method in certain cases? How do I disable the interceptor? In case with overriding SaveChanges it's easy.
Ответитьsimple but useful 👍
ОтветитьI see, seems interesting. Currently I am overriding the savechangesasync method but it has some issues in my use cases. This seems to resolve those definately will give it try :) Thanks :)
ОтветитьCan you share a sample project with good DDD/CQRS pratices?
ОтветитьHow would one pass a username to this interceptor so that a name can be audited
ОтветитьOpinions on using this approach vs having DB triggers for Insert/Update/Delete operations?
ОтветитьThanks, nice video. I think VS2022 has also the possibility to cleanup unused namespaces on file save
ОтветитьIs It possible to recaive link to github for that code?
Ответить