diff --git a/samples/dotnetbot/Dockerfile b/samples/dotnetbot/Dockerfile new file mode 100644 index 000000000000..ab7e3aa3c5e7 --- /dev/null +++ b/samples/dotnetbot/Dockerfile @@ -0,0 +1,4 @@ +FROM microsoft/dotnet +COPY bin/Debug/netcoreapp1.0 app +WORKDIR app +ENTRYPOINT ["dotnet", "dotnetbot.dll"] diff --git a/samples/dotnetbot/Program.cs b/samples/dotnetbot/Program.cs index 2d59d407ad9d..09cceb07800d 100644 --- a/samples/dotnetbot/Program.cs +++ b/samples/dotnetbot/Program.cs @@ -1,29 +1,23 @@ using System; -namespace DotnetBot +public static class Program { - public static class Program - { - public static void Main(string[] args) - { - string message = ""; - if (args.Length < 1) - { - message = "Welcome to .NET Core!"; - } else - { - foreach (string item in args) - { - message += item; - } - } - Console.WriteLine(GetBot(message)); - } + public static void Main(string[] args) + { + string message = "Dotnet-bot: Welcome to using .NET Core!"; + + if (args.Length > 0) + { + message = String.Join(" ",args); + } + + Console.WriteLine(GetBot(message)); + } - public static string GetBot(string message) - { - string bot = "\n" + " " + message; - bot += @" + public static string GetBot(string message) + { + string bot = $"\n {message}"; + bot += @" __________________ \ \ @@ -63,9 +57,7 @@ ......... .............. ..... "; - return bot; - } + return bot; + } - - } }