临河任务调度
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

33 řádky
886B

  1. using System.Threading.Tasks;
  2. using Volo.Abp.Data;
  3. using Volo.Abp.DependencyInjection;
  4. using Volo.Abp.Guids;
  5. using Volo.Abp.MultiTenancy;
  6. namespace Himp.TaskScheduling;
  7. public class TaskSchedulingDataSeedContributor : IDataSeedContributor, ITransientDependency
  8. {
  9. private readonly IGuidGenerator _guidGenerator;
  10. private readonly ICurrentTenant _currentTenant;
  11. public TaskSchedulingDataSeedContributor(
  12. IGuidGenerator guidGenerator, ICurrentTenant currentTenant)
  13. {
  14. _guidGenerator = guidGenerator;
  15. _currentTenant = currentTenant;
  16. }
  17. public Task SeedAsync(DataSeedContext context)
  18. {
  19. /* Instead of returning the Task.CompletedTask, you can insert your test data
  20. * at this point!
  21. */
  22. using (_currentTenant.Change(context?.TenantId))
  23. {
  24. return Task.CompletedTask;
  25. }
  26. }
  27. }