Exemple #1
0
 public void Delete(AllowedIp poco)
 {
     using (var scope = _scopeProvider.CreateScope())
     {
         scope.Database.Delete(poco);
         scope.Complete();
     }
 }
Exemple #2
0
        public AllowedIp Update(AllowedIp poco)
        {
            using (var scope = _scopeProvider.CreateScope())
            {
                scope.Database.Update(poco);
                scope.Complete();
            }

            return(poco);
        }
        public AllowedIpDto Create(string ipAddress, string notes)
        {
            var poco = new AllowedIp()
            {
                IpAddress   = ipAddress,
                LastUpdated = DateTime.Now.ToUniversalTime(),
                Notes       = notes
            };

            return(_repository.Create(poco).ToDto());
        }
        public AllowedIpDto Update(AllowedIpDto dto)
        {
            var poco = new AllowedIp()
            {
                Id          = dto.Id,
                IpAddress   = dto.IpAddress,
                Notes       = dto.Notes,
                LastUpdated = DateTime.Now.ToUniversalTime()
            };

            return(_repository.Update(poco).ToDto());
        }
        public static AllowedIpDto ToDto(this AllowedIp poco)
        {
            var dto = new AllowedIpDto()
            {
                Id          = poco.Id,
                IpAddress   = poco.IpAddress,
                Notes       = poco.Notes,
                LastUpdated = poco.LastUpdated,
            };

            return(dto);
        }
Exemple #6
0
        public AllowedIp Create(AllowedIp poco)
        {
            var idObj = new object();

            using (var scope = _scopeProvider.CreateScope())
            {
                idObj = scope.Database.Insert(poco);
                scope.Complete();
            }

            var item = GetById(Convert.ToInt32(idObj));

            return(item);
        }