after call BaseDataProvider.GetTable(), need to dispose DataContext ?

5 months ago
After call BaseDataProvider.GetTable(), do I need to dispose DataContext manually ?
Unlike other methods (ex. InsertEntityAsync()), they use using to dispose DataContext.


ref: https://github.com/nopSolutions/nopCommerce/blob/develop/src/Libraries/Nop.Data/DataProviders/BaseDataProvider.cs#L240
5 months ago
This is not required, according to their documentation. Anyway you get IQueryable result which is not disposable.
https://linq2db.github.io/articles/general/Managing-data-connection.html
If this example the query is not sent to the database. It will be executed later when we enumerate IQuerable. DataContext will handle the connection release properly


UPD: InsertEntityAsync uses DataConnection instead of DataContext.
5 months ago
Thanks. It helps me a lot. 👍