Skip to content
Permalink
Browse files

修复非必须也会提示值为空的问题

  • Loading branch information
Kation committed Oct 28, 2019
1 parent 0ad8272 commit c54b34875ba8078c1d83367824759283b4f037d1
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/Wodsoft.ComBoost.Data.Core/Wodsoft/ComBoost/FromEntityAttribute.cs
@@ -28,7 +28,10 @@ public override object GetValue(IDomainExecutionContext executionContext, Parame
IValueProvider provider = executionContext.DomainContext.GetRequiredService<IValueProvider>();
object value = provider.GetValue(Name ?? parameter.Name, EntityDescriptor.GetMetadata(parameter.ParameterType).KeyType);
if (value == null)
throw new DomainServiceException(new ArgumentNullException(parameter.Name, "获取" + (Name ?? parameter.Name) + "实体的值为空。"));
if (IsRequired)
throw new DomainServiceException(new ArgumentNullException(parameter.Name, "获取" + (Name ?? parameter.Name) + "实体的值为空。"));
else
return null;
var databaseContext = executionContext.DomainContext.GetRequiredService<IDatabaseContext>();
dynamic entityContext;
//if (parameter.ParameterType.GetTypeInfo().IsInterface)

0 comments on commit c54b348

Please sign in to comment.
You can’t perform that action at this time.