Hi, I would like to be able in my Domain Manager to update the State of objects to Deleted, Added, Updated, etc. Then in one single method do a batch SaveChanges() instead of having to update one object at a time.
While using IRepository<T> I couldn't see a place where I can access the Context or be able to change state of entities. How is this doable with this framework?
Thanks
6 Answer(s)
-
0
Hi,
ABP or AspNet Zero does not support batch operations. You can create a custom repository, see <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Repositories#custom-repositories">http://aspnetboilerplate.com/Pages/Docu ... positories</a> and access dbcontext in it.
-
0
How would you do batch? If you needed to have this feature, shall I go by custom repository?
Thanks
-
0
Hi,
Actually it depends on how much record are you going to operate on. If it is too much, I would use SQL query, if it is just a few records I would use classic repositories.
-
0
So, it is fine like to update record by record for few records? (10 or so?)
SQL is an option, I could write an update for each record and send them in one shot.
-
0
Have a look at this library: <a class="postlink" href="https://github.com/zzzprojects/EntityFramework-Plus">https://github.com/zzzprojects/EntityFramework-Plus</a>
Seems this allows batch update or create. Looks interesting.
-
0
Thanks,
I have seen it but we didn't try it with ABP or AspNet Zero before. I will try it if I have free time.