Ejemplo n.º 1
0
        /// <summary>
        /// Create MapTenant
        /// </summary>
        /// <param name="mapTenant"></param>
        /// <returns></returns>
        public virtual async Task CreateAsync(MapTenant mapTenant)
        {
            //Validate
            await ValidateTenantAsync(mapTenant.TenantId);
            await ValidateCodeAsync(mapTenant.Code);

            await MapTenantRepository.InsertAsync(mapTenant);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public virtual async Task <Guid> CreateAsync(CreateMapTenantDto input)
        {
            await CheckMapTenantAsync(input.Code, null);

            var mapTenant = new MapTenant(
                GuidGenerator.Create(),
                input.Code,
                input.TenantId,
                input.MapCode);

            await MapTenantRepository.InsertAsync(mapTenant);

            return(mapTenant.Id);
        }
Ejemplo n.º 4
0
        public static MapTenantCacheItem AsCacheItem([NotNull] this MapTenant mapTenant)
        {
            Check.NotNull(mapTenant, nameof(mapTenant));
            if (mapTenant == null || mapTenant == default)
            {
                return(null);
            }

            var cacheItem = new MapTenantCacheItem(
                mapTenant.Code,
                mapTenant.TenantId,
                mapTenant.MapCode);

            return(cacheItem);
        }
Ejemplo n.º 5
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);
        }