how to add interceptor?
javadinasabVahid opened this issue · 3 comments
javadinasabVahid commented
I could not override the configuration
Please help me
sjh37 commented
There are interceptors in your <database>.tt
file. You will see them called as a delegate
such as:
- Settings.TableRename
- Settings.UpdateTable
- Settings.UpdateColumn
- etc
What is it you are trying to do?
javadinasabVahid commented
Thanks for the guide.
I meant this piece of code
`protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.AddInterceptors(new IgnoreTrackingInterceptor());
}`
How to use AddInterceptors?
sjh37 commented
I don't have a callback for that, so you will have to tweak the .ttinclude file.
Search for optionsBuilder.UseLazyLoadingProxies();{{#newline}}
There will be a few results, two each for EFCore3
, EFCore6
, EFCore7
, EFCore8
Try adding in your line above
{{#if UseLazyLoadingProxies}}
optionsBuilder.UseLazyLoadingProxies();{{#newline}}
{{/if}}