Skip to content

Commit

Permalink
ActivatorUtilities.CreateInstance => Activator.CreateInstance in some…
Browse files Browse the repository at this point in the history
… cases
  • Loading branch information
kerryjiang committed Aug 26, 2023
1 parent d9a691a commit 07d5a6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/SuperSocket.Command/CommandMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ private void RegisterCommandSetFactoriesFromServices(List<ICommandSetFactory> co
if (commandWrapFactory != null)
{
var commandWrapType = commandWrapFactory(command.GetType());
cmd = ActivatorUtilities.CreateInstance(null, commandWrapType, command) as ICommand;
cmd = Activator.CreateInstance(commandWrapType, command) as ICommand;
}

var commandTypeInfo = new CommandTypeInfo(cmd);
commandTypeInfo.ActualCommandType = actualCommandType;
commandSetFactories.Add(ActivatorUtilities.CreateInstance(null, commandSetFactoryType, commandTypeInfo) as ICommandSetFactory);
commandSetFactories.Add(Activator.CreateInstance(commandSetFactoryType, commandTypeInfo) as ICommandSetFactory);
}
}

Expand Down Expand Up @@ -256,7 +256,7 @@ public ICommandSetFactory CreateCommandSetFactory(Type type)
{
var commandTyeInfo = new CommandTypeInfo(WrapRequired ? WrapFactory(type) : type, null);
commandTyeInfo.ActualCommandType = type;
return ActivatorUtilities.CreateInstance(null, this.CommandSetFactoryType, commandTyeInfo) as ICommandSetFactory;
return Activator.CreateInstance(this.CommandSetFactoryType, commandTyeInfo) as ICommandSetFactory;
}
}

Expand Down

0 comments on commit 07d5a6f

Please sign in to comment.