Hi There
I am trying to delete all records that are linked to a particular UserId. I have added a foreign key to the user table.
I am using the following Function
await _userCategoryRepository.DeleteAsync(p => p.UserId == AbpSession.UserId.GetValueOrDefault());
Could it have something to do with Cascade delete.
I dont want to lookup all the items then delete them as it will add processing time.
Thanks
6 Answer(s)
-
0
What's the error?
-
0
Was testing it from Swagger as its going to be called from a mobile app.
An internal error occurred during your request!
I will put a try catch and see what the error is.
-
0
You can check Logs.txt for full stack trace.
-
0
This is the error in the log file
System.NotSupportedException: LINQ to Entities does not recognize the method 'Int64 GetValueOrDefault()' method, and this method cannot be translated into a store expression.
-
0
Change to AbpSession.UserId.Value
-
0
Awesom working now thanks