Skip to content

Commit

Permalink
remove warnings for dotnet build
Browse files Browse the repository at this point in the history
  • Loading branch information
ivorb authored Jan 11, 2024
1 parent 1f663d2 commit 1314684
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Labfiles/05-image-generation/CSharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ namespace generate_image
{
class Program
{
private static string aoaiEndpoint;
private static string aoaiKey;
private static string? aoaiEndpoint;
private static string? aoaiKey;
static async Task Main(string[] args)
{
try
{
// Get config settings from AppSettings
IConfigurationBuilder builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
IConfigurationRoot configuration = builder.Build();
aoaiEndpoint = configuration["AzureOAIEndpoint"];
aoaiKey = configuration["AzureOAIKey"];
aoaiEndpoint = configuration["AzureOAIEndpoint"] ?? "";
aoaiKey = configuration["AzureOAIKey"] ?? "";

// Get prompt for image to be generated
Console.Clear();
string prompt = "";
Console.WriteLine("Enter a prompt to request an image:");
prompt = Console.ReadLine();
string prompt = Console.ReadLine() ?? "";

// Make the initial call to start the job
using (var client = new HttpClient())
Expand Down

2 comments on commit 1314684

@SvenSowa
Copy link

@SvenSowa SvenSowa commented on 1314684 Jan 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduced a bug in line 31. You defined the variable "prompt" twice. Either remove line 29 or fix 31, my take.

@ivorb
Copy link
Collaborator Author

@ivorb ivorb commented on 1314684 Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed with 0635d77

Please sign in to comment.