简体   繁体   中英

wcf rest service idempotent

I am developing a wcf Service in c# and I am searching for a way to make my Service methods or the Service itself as idempotent. Is there an easy way to do this by marking the Service with an attribute or something like that? If not does anybody have a code snippet for this?

There's no magic attribute that will make your service idempotent. It's up to your implementation to handle that. For example if your service performs an add to a database then you need to check for the object's existence prior to adding it so you don't add it twice to the db.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM