2025-06-17 17:34:03 +05:30

27 lines
645 B
C#

using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace Acme.BookStore;
public class BookStoreTestDataSeedContributor : IDataSeedContributor, ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
public BookStoreTestDataSeedContributor(ICurrentTenant currentTenant)
{
_currentTenant = currentTenant;
}
public Task SeedAsync(DataSeedContext context)
{
/* Seed additional test data... */
using (_currentTenant.Change(context?.TenantId))
{
return Task.CompletedTask;
}
}
}