Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何设计数据库以支持每个表的“所有者”_C#_Database_Sql Server 2008_Design Patterns - Fatal编程技术网

C# 如何设计数据库以支持每个表的“所有者”

C# 如何设计数据库以支持每个表的“所有者”,c#,database,sql-server-2008,design-patterns,C#,Database,Sql Server 2008,Design Patterns,我的应用程序具有身份验证,用户若要编辑某行,必须获得授权才能成为该行的所有者。可以有多个所有者 这不是一个简单的例子,只需创建一个owner-1:n-hasPermission-n:1-Table,因为在50个左右有很多表,而且计数可能会随着时间的推移而增加 我现在唯一能做的就是创建如下内容: Permission UserId --references Users table TableName -- name of the table he has permissions

我的应用程序具有身份验证,用户若要编辑某行,必须获得授权才能成为该行的所有者。可以有多个所有者

这不是一个简单的例子,只需创建一个owner-1:n-hasPermission-n:1-Table,因为在50个左右有很多表,而且计数可能会随着时间的推移而增加

我现在唯一能做的就是创建如下内容:

 Permission
    UserId --references Users table
    TableName -- name of the table he has permissions for
    RowId -- Id of the table row that he can edit
我可以看出这有很多问题。。。一致性,把他所有的行都拉到对象中,等等

还有其他的模式吗


编辑:至于问题的规模:预计约有5万用户,50个表,每个表最多约10万行。

2005年时代有一份很好的technet白皮书,关于SQL Server数据库


对于您的应用程序来说,他们所做的很多工作可能都有些过头了,但这可能会让您了解如何实施更简单的方案。

也许可以为每个人使用单独的视图,并在视图中进行编辑/更新。预期用户数约为50k-您的意思是在他们登录时动态创建视图吗?我怎么知道什么时候处理它?或者你的意思是让视图对每个用户保持持久性?你知道,5万个可能的所有者可能是你想在问题中包含的重要信息。。。。坐在其他可能有助于确定问题规模的东西上?