From 5db3a31fa1b140e8aaf7b40f98f01a94cfa715c8 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Thu, 8 Oct 2020 16:26:04 +0300 Subject: [PATCH] Update How-To-Add-Custom-Property-To-The-User-Entity.md --- ...-To-Add-Custom-Property-To-The-User-Entity.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md b/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md index 1143af5a92..88ec637f9e 100644 --- a/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md +++ b/docs/en/Community-Articles/2020-10-08-How-To-Add-Custom-Property-To-The-User-Entity/How-To-Add-Custom-Property-To-The-User-Entity.md @@ -47,7 +47,7 @@ public int Reputation { get; protected set; } Create the Users folder in the **CustomizeUserDemo.Domain.Shared** project, create the class `UserConsts` inside the folder and update the class you created as below: ```csharp -public class UserConst +public static class UserConsts { public const string TitlePropertyName = "Title"; @@ -83,13 +83,13 @@ public static class CustomizeUserDemoEfCoreEntityExtensionMappings (entityBuilder, propertyBuilder) => { propertyBuilder.IsRequired(); - propertyBuilder.HasMaxLength(UserConst.MaxTitleLength); + propertyBuilder.HasMaxLength(UserConsts.MaxTitleLength); } ).MapEfCoreProperty( nameof(AppUser.Reputation), (entityBuilder, propertyBuilder) => { - propertyBuilder.HasDefaultValue(UserConst.MinReputationValue); + propertyBuilder.HasDefaultValue(UserConsts.MinReputationValue); } ); }); @@ -133,22 +133,22 @@ private static void ConfigureExtraProperties() identity.ConfigureUser(user => { user.AddOrUpdateProperty( - UserConst.TitlePropertyName, + UserConsts.TitlePropertyName, options => { options.Attributes.Add(new RequiredAttribute()); options.Attributes.Add( - new StringLengthAttribute(UserConst.MaxTitleLength) + new StringLengthAttribute(UserConsts.MaxTitleLength) ); } ); user.AddOrUpdateProperty( - UserConst.ReputationPropertyName, + UserConsts.ReputationPropertyName, options => { - options.DefaultValue = UserConst.MinReputationValue; + options.DefaultValue = UserConsts.MinReputationValue; options.Attributes.Add( - new RangeAttribute(UserConst.MinReputationValue, UserConst.MaxReputationValue) + new RangeAttribute(UserConsts.MinReputationValue, UserConsts.MaxReputationValue) ); } );