Example #1
0
 public MapTenantAppService(
     MapTenantManager mapTenantManager,
     IMapTenantRepository mapTenantRepository)
 {
     MapTenantManager    = mapTenantManager;
     MapTenantRepository = mapTenantRepository;
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
 public virtual async Task UpdateAsync(Guid id, UpdateMapTenantDto input)
 {
     await MapTenantManager.UpdateAsync(id, input.Code, input.TenantId, input.MapCode);
 }