0

Is it possible to simplify this in one single line of code?

Thanks.

public static string BuildAutoLoginUrl(string username)
{
#if DEBUG
   return @"/Account/AutoLogin?key=" + GetAutoLoginKey(username);
#else
   return @"http://www.domain.com/Account/AutoLogin?key=" + GetAutoLoginKey(username);
#endif
}
abenci
  • 8,422
  • 19
  • 69
  • 134

1 Answers1

-1

No

According to the documentation for C# preprocessor directives it states the following:

A preprocessor directive must be the only instruction on a line.

Therefore the answer is no, it's not possible to reduce the code down to one line.

Luke
  • 22,826
  • 31
  • 110
  • 193