private IStatusGeneric <int> ReturnSuccessFullResult(CascadeSoftDelWhatDoing whatDoing, int numFound) { var status = new StatusGenericHandler <int>(); status.SetResult(numFound); switch (whatDoing) { case CascadeSoftDelWhatDoing.SoftDelete: status.Message = FormMessage("soft deleted", numFound); break; case CascadeSoftDelWhatDoing.ResetSoftDelete: status.Message = FormMessage("recovered", numFound); break; case CascadeSoftDelWhatDoing.CheckWhatWillDelete: status.Message = numFound == 0 ? "No entries will be hard deleted" : $"Are you sure you want to hard delete this entity{DependentsSuffix(numFound)}"; break; case CascadeSoftDelWhatDoing.HardDeleteSoftDeleted: status.Message = FormMessage("hard deleted", numFound); break; default: throw new ArgumentOutOfRangeException(); } return(status); }
public CascadeWalker(DbContext context, SoftDeleteConfiguration <TInterface, byte> config, CascadeSoftDelWhatDoing whatDoing, bool readEveryTime) { _context = context; _config = config; _whatDoing = whatDoing; _readEveryTime = readEveryTime; }
public CascadeWalker(DbContext context, CascadeSoftDeleteConfiguration <TInterface> config, bool isAsync, CascadeSoftDelWhatDoing whatDoing, bool readEveryTime) { _context = context; _config = config; _isAsync = isAsync; _whatDoing = whatDoing; _readEveryTime = readEveryTime && whatDoing == CascadeSoftDelWhatDoing.SoftDelete; }