• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UserKey类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UserKey的典型用法代码示例。如果您正苦于以下问题:C# UserKey类的具体用法?C# UserKey怎么用?C# UserKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UserKey类属于命名空间,在下文中一共展示了UserKey类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Two_keys_with_same_value

        public void Two_keys_with_same_value()
        {
            var one = new UserKey("one");
            var two = new UserKey("one");

            one.ShouldBe(two);
        }
开发者ID:Pondidum,项目名称:Magistrate,代码行数:7,代码来源:UserKeyTests.cs


示例2: Two_different_keys

        public void Two_different_keys()
        {
            var one = new UserKey("one");
            var two = new UserKey("two");

            one.ShouldNotBe(two);
        }
开发者ID:Pondidum,项目名称:Magistrate,代码行数:7,代码来源:UserKeyTests.cs


示例3: GetUserDetails

		private async Task GetUserDetails(IOwinContext context)
		{
			var key = new UserKey(context.GetRouteValue("key"));
			var user = _collectionsReadModel.Users.Single(r => r.Key == key);

			await context.WriteJson(user, _settings);
		}
开发者ID:Pondidum,项目名称:Magistrate,代码行数:7,代码来源:UsersController.cs


示例4: GetAccess

 /// <summary>
 /// Gets a specific access for a user.
 /// </summary>
 /// <param name="aUserKey">A user key composite.</param>
 /// <param name="aFunction">A function.</param>
 /// <returns></returns>
 public static Access GetAccess(UserKey aUserKey, string aFunction)
 {
     UserFunctionAccess vUserFunctionAccess = new UserFunctionAccess() { UsrKey = aUserKey.UsrKey };
     vUserFunctionAccess.FunctionAccess.Function = aFunction;
     Load(vUserFunctionAccess);
     return vUserFunctionAccess.FunctionAccess.Access;
 }
开发者ID:heinschulie,项目名称:z2z,代码行数:13,代码来源:UserFunctionAccessData.cs


示例5: UserCreatedEvent

 public UserCreatedEvent(Operator @operator, Guid id, UserKey key, string name)
     : base(@operator)
 {
     ID = id;
     Key = key;
     Name = name;
 }
开发者ID:Pondidum,项目名称:Magistrate,代码行数:7,代码来源:UserCreatedEvent.cs


示例6: Two_keys_with_different_values_by_case

        public void Two_keys_with_different_values_by_case()
        {
            var one = new UserKey("one");
            var two = new UserKey("ONE");

            one.ShouldBe(two);
        }
开发者ID:Pondidum,项目名称:Magistrate,代码行数:7,代码来源:UserKeyTests.cs


示例7: When_serializing

        public void When_serializing()
        {
            var input = new UserKey("one");
            var json = JsonConvert.SerializeObject(input);
            var output = JsonConvert.DeserializeObject<UserKey>(json);

            output.ShouldBe(input);
        }
开发者ID:Pondidum,项目名称:Magistrate,代码行数:8,代码来源:UserKeyTests.cs


示例8: GetUser

        internal User GetUser(UserKey key, bool manageRole = true)
        {
            User user = _userModule.Get(key);

            if(user != null && manageRole)
                CompleteUserRole(user);

            return user;
        }
开发者ID:Thetyne,项目名称:BodyReport,代码行数:9,代码来源:UserManager.cs


示例9: AddUser

 /// <summary>
 ///   The <c>AddUser</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="User"/> object.
 ///   It invokes the <c>Insert</c> method of <see cref="UserBusiness"/> with the newly deserialized <see cref="User"/> object.
 ///   Finally, it returns the inserted object (now with an assigned User Key) as a serialized <see cref="string"/> of XML.
 /// </summary>
 /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
 /// <returns><see cref="User"/> as XML <see cref="string"/>.</returns>
 /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
 public static string AddUser(UserKey aUserKey, string aXmlArgument)
 {
     if (aXmlArgument == null)
     {
         throw new ArgumentNullException("aXmlArgument of AddUser");
     }
     User vUser = new User();
     vUser = XmlUtils.Deserialize<User>(aXmlArgument);
     UserBusiness.Insert(aUserKey, vUser);
     return XmlUtils.Serialize<User>(vUser, true);
 }
开发者ID:heinschulie,项目名称:zfit,代码行数:19,代码来源:UserImplementation.cs


示例10: AddRoleFunction

 /// <summary>
 ///   The <c>AddRoleFunction</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="RoleFunction"/> object.
 ///   It invokes the <c>Insert</c> method of <see cref="RoleFunctionBusiness"/> with the newly deserialized <see cref="RoleFunction"/> object.
 ///   Finally, it returns the inserted object (now with an assigned RoleFunction Key) as a serialized <see cref="string"/> of XML.
 /// </summary>
 /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
 /// <returns><see cref="RoleFunction"/> as XML <see cref="string"/>.</returns>
 /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
 public static string AddRoleFunction(UserKey aUserKey, string aXmlArgument)
 {
     if (aXmlArgument == null)
     {
         throw new ArgumentNullException("aXmlArgument of AddRoleFunction");
     }
     RoleFunction vRoleFunction = new RoleFunction();
     vRoleFunction = XmlUtils.Deserialize<RoleFunction>(aXmlArgument);
     RoleFunctionBusiness.Insert(aUserKey, vRoleFunction);
     return XmlUtils.Serialize<RoleFunction>(vRoleFunction, true);
 }
开发者ID:heinschulie,项目名称:zfit,代码行数:19,代码来源:UserImplementation.cs


示例11: AddDocument

 /// <summary>
 ///   The <c>AddDocument</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="Document"/> object.
 ///   It invokes the <c>Insert</c> method of <see cref="DocumentBusiness"/> with the newly deserialized <see cref="Document"/> object.
 ///   Finally, it returns the inserted object (now with an assigned Document Key) as a serialized <see cref="string"/> of XML.
 /// </summary>
 /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
 /// <returns><see cref="Document"/> as XML <see cref="string"/>.</returns>
 /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
 public static string AddDocument(UserKey aUserKey, string aXmlArgument)
 {
     if (aXmlArgument == null)
     {
         throw new ArgumentNullException("aXmlArgument of AddDocument");
     }
     Document vDocument = new Document();
     vDocument = XmlUtils.Deserialize<Document>(aXmlArgument);
     DocumentBusiness.Insert(aUserKey, vDocument);
     return XmlUtils.Serialize<Document>(vDocument, true);
 }
开发者ID:heinschulie,项目名称:z2z,代码行数:19,代码来源:UserImplementation.cs


示例12: AddContributor

 /// <summary>
 ///   The <c>AddContributor</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="Contributor"/> object.
 ///   It invokes the <c>Insert</c> method of <see cref="ContributorBusiness"/> with the newly deserialized <see cref="Contributor"/> object.
 ///   Finally, it returns the inserted object (now with an assigned Contributor Key) as a serialized <see cref="string"/> of XML.
 /// </summary>
 /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
 /// <returns><see cref="Contributor"/> as XML <see cref="string"/>.</returns>
 /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
 public static string AddContributor(UserKey aUserKey, string aXmlArgument)
 {
     if (aXmlArgument == null)
     {
         throw new ArgumentNullException("aXmlArgument of AddContributor");
     }
     Contributor vContributor = new Contributor();
     vContributor = XmlUtils.Deserialize<Contributor>(aXmlArgument);
     ContributorBusiness.Insert(aUserKey, vContributor);
     return XmlUtils.Serialize<Contributor>(vContributor, true);
 }
开发者ID:heinschulie,项目名称:z2z,代码行数:19,代码来源:UserImplementation.cs


示例13: AddContributorLanguage

 /// <summary>
 ///   The <c>AddContributorLanguage</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="ContributorLanguage"/> object.
 ///   It invokes the <c>Insert</c> method of <see cref="ContributorLanguageBusiness"/> with the newly deserialized <see cref="ContributorLanguage"/> object.
 ///   Finally, it returns the inserted object (now with an assigned ContributorLanguage Key) as a serialized <see cref="string"/> of XML.
 /// </summary>
 /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param>
 /// <returns><see cref="ContributorLanguage"/> as XML <see cref="string"/>.</returns>
 /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception>
 public static string AddContributorLanguage(UserKey aUserKey, string aXmlArgument)
 {
     if (aXmlArgument == null)
     {
         throw new ArgumentNullException("aXmlArgument of AddContributorLanguage");
     }
     ContributorLanguage vContributorLanguage = new ContributorLanguage();
     vContributorLanguage = XmlUtils.Deserialize<ContributorLanguage>(aXmlArgument);
     ContributorLanguageBusiness.Insert(aUserKey, vContributorLanguage);
     return XmlUtils.Serialize<ContributorLanguage>(vContributorLanguage, true);
 }
开发者ID:heinschulie,项目名称:z2z,代码行数:19,代码来源:UserImplementation.cs


示例14: Delete

        /// <summary>
        /// Delete data in database
        /// </summary>
        /// <param name="key">Primary Key</param>
        public void Delete(UserKey key)
        {
            if (key == null || string.IsNullOrWhiteSpace(key.Id))
                return;

            var row = _dbContext.Users.Where(m => m.Id == key.Id).FirstOrDefault();
            if (row != null)
            {
                _dbContext.Users.Remove(row);
                _dbContext.SaveChanges();
            }
        }
开发者ID:Thetyne,项目名称:BodyReport,代码行数:16,代码来源:UserModule.cs


示例15: Load

        /// <summary>
        ///   The overloaded Load method that will return a <see cref="LanguageCollection"/>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aLanguageCollection">A <see cref="LanguageCollection"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aLanguageCollection</c> argument is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, LanguageCollection aLanguageCollection)
        {
            if (aLanguageCollection == null)
            {
                throw new ArgumentNullException("Load Language Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "Language", AccessMode.List))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.List, "Language");
            }

            LanguageData.Load(aLanguageCollection);
        }
开发者ID:heinschulie,项目名称:z2z,代码行数:20,代码来源:LanguageBusiness.cs


示例16: Delete

        /// <summary>
        ///   Delete a <see cref="User"/> object passed as an argument.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aUser">A <see cref="User"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aUser</c> argument is <c>null</c>.</exception>
        public static void Delete(UserKey aUserKey, User aUser)
        {
            if (aUser == null)
            {
                throw new ArgumentNullException("Delete User Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "User", AccessMode.Delete))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Delete, "User");
            }

            UserData.Delete(aUser);
        }
开发者ID:heinschulie,项目名称:z2z,代码行数:20,代码来源:UserBusiness.cs


示例17: Insert

        /// <summary>
        ///   Insert a <see cref="Contributor"/> object passed as an argument via Stored Procedure that returns the newly inserted <i>Contributor Key</i>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aContributor">A <see cref="Contributor"/> object.</param>
        /// <exception cref="ArgumentNullException">If <c>aContributor</c> argument is <c>null</c>.</exception>
        public static void Insert(UserKey aUserKey, Contributor aContributor)
        {
            if (aContributor == null)
            {
                throw new ArgumentNullException("Insert Contributor Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "Contributor", AccessMode.Create))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Create, "Contributor");
            }

            ContributorData.Insert(aContributor);
        }
开发者ID:heinschulie,项目名称:z2z,代码行数:20,代码来源:ContributorBusiness.cs


示例18: Load

        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="ContributorLanguage"/> object, with keys in <c>aContributorLanguage</c>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aContributorLanguage">A <see cref="ContributorLanguage"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aContributorLanguage</c> is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, ContributorLanguage aContributorLanguage)
        {
            if (aContributorLanguage == null)
            {
                throw new ArgumentNullException("Load ContributorLanguage Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "ContributorLanguage", AccessMode.Read))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Read, "ContributorLanguage");
            }

            ContributorLanguageData.Load(aContributorLanguage);
        }
开发者ID:heinschulie,项目名称:z2z,代码行数:20,代码来源:ContributorLanguageBusiness.cs


示例19: Load

        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="WorkItem"/> object, with keys in <c>aWorkItem</c>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aWorkItem">A <see cref="WorkItem"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aWorkItem</c> is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, WorkItem aWorkItem)
        {
            if (aWorkItem == null)
            {
                throw new ArgumentNullException("Load WorkItem Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "WorkItem", AccessMode.Read))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Read, "WorkItem");
            }

            WorkItemData.Load(aWorkItem);
        }
开发者ID:heinschulie,项目名称:z2z,代码行数:20,代码来源:WorkItemBusiness.cs


示例20: Load

        /// <summary>
        ///   The overloaded Load method that will return a specific <see cref="Document"/> object, with keys in <c>aDocument</c>.
        /// </summary>
        /// <param name="aUserKey">A <see cref="UserKey"/> object.</param>
        /// <param name="aDocument">A <see cref="Document"/>.</param>
        /// <exception cref="ArgumentNullException">If <c>aDocument</c> is <c>null</c>.</exception>
        public static void Load(UserKey aUserKey, Document aDocument)
        {
            if (aDocument == null)
            {
                throw new ArgumentNullException("Load Document Business");
            }

            if (!UserFunctionAccessData.HasModeAccess(aUserKey, "Document", AccessMode.Read))
            {
                throw new ZpAccessException("Access Denied", String.Format("{0}", aUserKey.UsrKey), AccessMode.Read, "Document");
            }

            DocumentData.Load(aDocument);
        }
开发者ID:heinschulie,项目名称:z2z,代码行数:20,代码来源:DocumentBusiness.cs



注:本文中的UserKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UserLogin类代码示例发布时间:2022-05-24
下一篇:
C# UserItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap