-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove IActionContext.NewGuid()
& Add RandomExtension.GenerateRandomGuid()
#508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay without removing ActionContext.NewGuid()
?
/// <seealso cref="IRandom"/> | ||
public static Guid GenerateRandomGuid(this IRandom random) | ||
{ | ||
var bytes = new byte[16]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if there is mention as this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are fixed! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Unengine Still not addressed I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot to commit. I'll also commit your suggestions at once!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Job's done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write two entries to the changelog file.
Codecov Report
@@ Coverage Diff @@
## master #508 +/- ##
==========================================
+ Coverage 90.05% 90.07% +0.02%
==========================================
Files 200 201 +1
Lines 14718 14718
==========================================
+ Hits 13254 13257 +3
+ Misses 1180 1177 -3
Partials 284 284
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should fix some tests which uses NewGuid()
.
You're right. Job's done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
I think getting a random
Guid
inIActionContext
is a bad usage because dummy objects (for testing, debugging or etc ...) using randomGuid
in games don't needIActionContext
.IRandom
s are enough to acquire the same thing.So I removed
IActionContext.NewGuid()
.Instead I added an extension class,
RandomExtension
that includes a extension method,GenerateRandomGuid()
.Since
RandomExtension
is an extension class, I implemented generating a randomGuid
.