using System.Linq; using System.Reflection; using System.Threading.Tasks; using Aki.Reflection.Patching; using Aki.Reflection.Utils; using Aki.Core.Models; using FilesChecker; namespace Aki.Core.Patches { public class ConsistencySinglePatch : ModulePatch { protected override MethodBase GetTargetMethod() { return PatchConstants.FilesCheckerTypes.Single(x => x.Name == "ConsistencyController") .GetMethods().Single(x => x.Name == "EnsureConsistencySingle" && x.ReturnType == typeof(Task)); } [PatchPrefix] private static bool PatchPrefix(ref object __result) { __result = Task.FromResult(new FakeFileCheckerResult()); return false; } } }