« first day (4228 days earlier)      last day (722 days later) » 

3:27 AM
> else if (t.Equals(typeof(int)))
Console.WriteLine("{0} is a 32-bit integer.", value);
Is there a difference between t.Equals and simply using the operator ==?
> else if (t == typeof(int))
Console.WriteLine("{0} is a 32-bit integer.", value);
 
4:01 AM
[milleniumbug] in the general case, yes, as == is dispatched statically and .Equals is a virtual method, in the particular case where t is System.Type, no, they do the same thing
 
 
2 hours later…
5:35 AM
Thank you!
I don't understand what this line of code does:
> DateTime ToDateTime(IFormatProvider provider) =>
throw new InvalidCastException("Conversion to a DateTime is not supported.");
It's from the explanation of throw on MSDN, here
Is it a method specifically written to throw an exception every time the user tries to use the UpToDate time method?
 
 
5 hours later…
11:04 AM
 
11:49 AM
Thank you!
 
 
1 hour later…
1:03 PM
I don't understand the example code here.
If the AcctNumberFormat cannot format the object for some reason, it passes it to the method HandleOtherFormats, which uses
> return ((IFormattable)arg).ToString(format, CultureInfo.CurrentCulture);
But how does IFormattable.ToString know what the "format" line means? It can be either "H" or "I", but this method, IFormattableToString, cannot know it and cannot act accordingly.
Would it be a good question to ask on the main site, or would it be too stupid/simple?
 
 
1 hour later…
2:24 PM
I've read it several times, and looks like it's a "fallback code" that allows the program to process the usual snippets in strings, of the kind {1:C2}, which gives "$16.3" in their example.
It's so complicated.
 
 
4 hours later…
6:09 PM
I see a lot of example code that uses both SignInManager<T> and UserManager<T>. Is there reason to keep them separate as SignInManager has a UserManager property? For example:
_userManager.FindByEmailAsync(login.Email); vs _signInManager.UserManager.FindByEmailAsync(login.Email);
 

« first day (4228 days earlier)      last day (722 days later) »