brockallen / BrockAllen.MembershipReboot

MembershipReboot is a user identity management and authentication library.
Other
742 stars 238 forks source link

Adding and removing claims in a transaction #602

Closed KathleenDollard closed 8 years ago

KathleenDollard commented 8 years ago

We have a scenario where we are removing claims and adding new ones. If the new ones fail, we'd like to reset to the old ones. Transaction.

Is there a way to add transaction behavior to Add/Remove claims when going through the API? Or do you suggest bypassing the API and directly touching the Repo/DBContext for this? Or other thoughts.

Thanks loads!!!! Kathleen

christianacca commented 8 years ago

The UserAccountService has the UpdateClaims method that takes two collections - one for adding claims the other to remove them. Internally these changes are then saved to the database with a call to DbContext.SaveChanges which is itself is transactional.

KathleenDollard commented 8 years ago

Sounds perfect. Had overlooked it. Thanks!

brockallen commented 8 years ago

Thx @christianacca