本文介绍了将List属性添加到ASP.net MembershipUser对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我创建了一个带有Internet应用程序模板的ASP.net MVC4应用程序,并希望添加List< T>属性由ASP.net内置身份验证提供的MembershipUser对象。 此List属性将是StockPermission对象的列表: 公共类StockPermission { 私人股票; 私有字节afterSaveAction; private bool allowEditingStockDocs; private bool allowChangingUser; } 因此我的MembershipUser将包含StockPermission对象,这些对象允许MembershipUser使用List中的那些股票执行定义的操作 这意味着我想创建一个自定义MembershipUser,它将包含这样的属性: List< StockPermission> StockPermissions 我有没有办法实现它? 解决方案 将List属性添加到MembershipUser对象或者我们可以在本文中创建自定义MembershipProvider和自定义MembershipUser类的任何其他属性: http://msdn.microsoft.com/en-us/library/ms366730(v = VS.100)的.aspx [ ^ ] I have created an ASP.net MVC4 application with Internet application template, and want to add List<T> property to MembershipUser object provided by ASP.net builtin Authetication.This List property will be a list of StockPermission object:public class StockPermission { private Stock stock; private byte afterSaveAction; private bool allowEditingStockDocs; private bool allowChangingUser; }Therefore my MembershipUser will contain StockPermission objects which let MembershipUser to perform defined action with those Stocks in the ListThat means I want to create a custom MembershipUser which will contain property like this:List<StockPermission> StockPermissions Is there a way I can realize it? 解决方案 To add List property to our MembershipUser object or any other properties we can create custom MembershipProvider and custom MembershipUser classes describer in this article:http://msdn.microsoft.com/en-us/library/ms366730(v=vs.100).aspx[^] 这篇关于将List属性添加到ASP.net MembershipUser对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-27 14:00