Using 'nameof' operator instead of magic strings

This commit is contained in:
Hisham Abdullah Bin Ateya 2015-06-20 21:12:19 +03:00
parent 864ee7f347
commit 3930ab639b
1 changed files with 2 additions and 2 deletions

View File

@ -74,13 +74,13 @@ namespace Microsoft.AspNet.StaticFiles
var fileInfo = new FileInfo(fileName);
if (offset < 0 || offset > fileInfo.Length)
{
throw new ArgumentOutOfRangeException("offset", offset, string.Empty);
throw new ArgumentOutOfRangeException(nameof(offset), offset, string.Empty);
}
if (length.HasValue &&
(length.Value < 0 || length.Value > fileInfo.Length - offset))
{
throw new ArgumentOutOfRangeException("length", length, string.Empty);
throw new ArgumentOutOfRangeException(nameof(length), length, string.Empty);
}
#if DNX451