feat: implement analyzer and code fixer for identifying and fixing when a sync flag is not propagated correctly.
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync()
|
||||
{
|
||||
return await _dataService.GetCoreAsync(17);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await {|#0:_dataService.GetCoreAsync(17, false)|};
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetCoreAsync(17, sync);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetDataAsync(int id, bool sync = false, bool useCache = true);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await {|#0:_dataService.GetDataAsync(17)|};
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetDataAsync(int id, bool sync = false, bool useCache = true);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetDataAsync(17, sync);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await {|#0:_dataService.GetCoreAsync(17)|};
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetMoreDataAsync(bool runSynchronously = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool runSynchronously)
|
||||
{
|
||||
return await {|#0:_dataService.GetMoreDataAsync()|};
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetMoreDataAsync(bool runSynchronously = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool runSynchronously)
|
||||
{
|
||||
return await _dataService.GetMoreDataAsync(runSynchronously);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetCoreAsync(17, sync);
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetDataAsync(bool sync = false);
|
||||
Task<string> GetMoreDataAsync(bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
var a = await _dataService.GetDataAsync(sync);
|
||||
var b = await {|#0:_dataService.GetMoreDataAsync()|};
|
||||
return a + b;
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetDataAsync(bool sync = false);
|
||||
Task<string> GetMoreDataAsync(bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
var a = await _dataService.GetDataAsync(sync);
|
||||
var b = await _dataService.GetMoreDataAsync(sync);
|
||||
return a + b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetCoreAsync(id: 17, sync: sync);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await {|#0:_dataService.GetCoreAsync(17, sync: false)|};
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetCoreAsync(17, sync: sync);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetCoreAsync(17, sync);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public interface IDataService
|
||||
{
|
||||
Task<string> GetCoreAsync(int id, bool sync = false);
|
||||
}
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private readonly IDataService _dataService;
|
||||
public BusinessLogic(IDataService dataService) { _dataService = dataService; }
|
||||
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
return await _dataService.GetCoreAsync(17, sync);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class BusinessLogic
|
||||
{
|
||||
private async Task<string> GetFrobCoreAsync(bool sync)
|
||||
{
|
||||
await Task.Delay(100);
|
||||
return "done";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user