WebApi接口防止表单重复提交最简单粗暴的解决方案

SQLServer中给表增加组合唯一约束

将两个或者多个字段一起约束成一个唯一约束

ALTER TABLE Reg_User_Relationship
ADD CONSTRAINT UC_UniqueValue UNIQUE (UserId,RUserId,RelationshipStatus)

当有重复的数据插入的时候

参考文献:https://www.w3school.com.cn/sql/sql_unique.asp

原文地址:https://www.cnblogs.com/yechangzhong-826217795/p/12836485.html