-
Notifications
You must be signed in to change notification settings - Fork 770
Open
Description
描述一下BUG
定义一个枚举,继承 ushort
public enum EGenderType : ushort
{
男 = 0,
女 = 1,
未知性别 = 2,
未说明性别 = 9
}重现步骤
- 启动,在收集实体信息时报错
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'AuthCenter.Core.Enums.EGenderType' to type 'System.Int32'.
Source=System.Linq
StackTrace:
在 System.Linq.Enumerable.<CastIterator>d__68`1.MoveNext() 在 /_/src/libraries/System.Linq/src/System/Linq/Cast.cs 中: 第 55 行
在 System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items) 在 /_/src/libraries/Common/src/System/Collections/Generic/LargeArrayBuilder.SpeedOpt.cs 中: 第 112 行
在 System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source) 在 /_/src/libraries/Common/src/System/Collections/Generic/EnumerableHelpers.Linq.cs 中: 第 84 行
在 OSharp.Authorization.EntityInfos.EntityInfoBase.<>c.<FromType>b__18_1(PropertyInfo property)
在 System.Linq.Enumerable.WhereSelectArrayIterator`2.ToArray() 在 /_/src/libraries/System.Linq/src/System/Linq/Where.SpeedOpt.cs 中: 第 218 行
在 OSharp.Authorization.EntityInfos.EntityInfoBase.FromType(Type entityType)
在 OSharp.Authorization.EntityInfos.EntityInfoHandlerBase`2.Initialize()
在 OSharp.Authorization.EntityInfos.EntityInfoPack.UsePack(IServiceProvider provider)
在 Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions.UseOSharp(WebApplication app)
在 Schoolmate.Startup.Configure(WebApplication app) 在 D:\Workspace\QBN\Schoolmate\Schoolmate\Startup.cs 中: 第 62 行
在 Program.<Main>$(String[] args) 在 D:\Workspace\QBN\Schoolmate\Schoolmate\Program.cs 中: 第 9 行
期望行为
枚举转换时不应该粗暴的转成int
Metadata
Metadata
Assignees
Labels
No labels