public MapTenantAppService( MapTenantManager mapTenantManager, IMapTenantRepository mapTenantRepository) { MapTenantManager = mapTenantManager; MapTenantRepository = mapTenantRepository; }
public virtual async Task <Guid> CreateAsync(CreateMapTenantDto input) { var mapTenant = new MapTenant( GuidGenerator.Create(), input.Code, input.TenantId, input.MapCode); await MapTenantManager.CreateAsync(mapTenant); return(mapTenant.Id); }
public virtual async Task UpdateAsync(UpdateMapTenantDto input) { var mapTenant = await MapTenantRepository.GetAsync(input.Id, true); if (mapTenant == null) { throw new AbpException($"Could not find MapTenant by id :{input.Id}."); } //Validate tenant await MapTenantManager.ValidateTenantAsync(input.TenantId, input.Id); //Validate code await MapTenantManager.ValidateCodeAsync(input.Code, mapTenant.Id); mapTenant.Update(input.Code, input.TenantId, input.MapCode); }
public virtual async Task <Guid> CreateAsync(CreateMapTenantDto input) { //Validate tenant await MapTenantManager.ValidateTenantAsync(input.TenantId, null); //Validate code await MapTenantManager.ValidateCodeAsync(input.Code); var mapTenant = new MapTenant( GuidGenerator.Create(), input.Code, input.TenantId, input.MapCode); await MapTenantRepository.InsertAsync(mapTenant); return(mapTenant.Id); }
public virtual async Task UpdateAsync(Guid id, UpdateMapTenantDto input) { await MapTenantManager.UpdateAsync(id, input.Code, input.TenantId, input.MapCode); }