You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public Configuration[] Configurations { get; set; }
78
+
}
79
+
80
+
public class Configuration
81
+
{
82
+
public Guid Id { get; set; }
83
+
public string ConfigurationName { get; set; }
84
+
}
85
+
}";
86
+
87
+
varfixtest=@"
88
+
using System;
89
+
using System.IO;
90
+
using System.Linq;
91
+
using System.Threading.Tasks;
92
+
93
+
public class TestClass
94
+
{
95
+
private string _workspaceFile;
96
+
97
+
public async Task<Configuration[]> LoadStorageContentAsync()
98
+
{
99
+
var fileInfo = new FileInfo(_workspaceFile);
100
+
if (!fileInfo.Exists)
101
+
{
102
+
Log.Error($""No configuration storage located at {fileInfo.FullName}."");
103
+
return Array.Empty<Configuration>();
104
+
}
105
+
106
+
using (var stream = new StreamReader(new FileStream(fileInfo.FullName, FileMode.Open)))
107
+
{
108
+
try
109
+
{
110
+
var storage = new Storage();
111
+
return storage.Configurations.ToArray();
112
+
}
113
+
catch (Exception e)
114
+
{
115
+
Log.Error(e);
116
+
return Array.Empty<Configuration>();
117
+
}
118
+
}
119
+
}
120
+
121
+
public class Log
122
+
{
123
+
public static void Error(Exception p0)
124
+
{
125
+
throw new NotImplementedException();
126
+
}
127
+
128
+
public static void Error(string p0)
129
+
{
130
+
throw new NotImplementedException();
131
+
}
132
+
}
133
+
134
+
public class Storage
135
+
{
136
+
public Configuration[] Configurations { get; set; }
137
+
}
138
+
139
+
public class Configuration
140
+
{
141
+
public Guid Id { get; set; }
142
+
public string ConfigurationName { get; set; }
143
+
}
144
+
}";
145
+
vardiagnostics=new[]
146
+
{
147
+
// Test0.cs(17,11): error CS4016: Since this is an async method, the return expression must be of type 'TestClass.Configuration[]' rather than 'Task<TestClass.Configuration[]>'
// Test0.cs(25,12): error CS4016: Since this is an async method, the return expression must be of type 'TestClass.Configuration[]' rather than 'Task<TestClass.Configuration[]>'
// Test0.cs(30,12): error CS4016: Since this is an async method, the return expression must be of type 'TestClass.Configuration[]' rather than 'Task<TestClass.Configuration[]>'
0 commit comments