示例#1
0
        public async Task <Ip> AddIpAsync(IPDetails clientIpDetail, string ipAddress)
        {
            var ipDetail = await IpDetails(clientIpDetail, ipAddress);

            await _dbContext.IpAddressess.AddAsync(ipDetail);

            await _dbContext.SaveChangesAsync();

            return(ipDetail);
        }
示例#2
0
        public async Task <Job> CreateJobAsync(string[] ipAddressess)
        {
            var job = new Job()
            {
                Completed = 0,
                Id        = Guid.NewGuid(),
                Total     = ipAddressess.Length,
            };

            await _dbContext.Jobs.AddAsync(job);

            await _dbContext.SaveChangesAsync();

            await CreateJobDetails(ipAddressess, job.Id);

            return(job);
        }