Ejemplo n.º 1
0
        public IPBan CreateIPBan(IPAddress ip, string notes, DateTime?expiry)
        {
            Contract.Requires(ip != null);
            Contract.Ensures(Contract.Result <IPBan>() != null);

            var rec = new IPBanRecord(ip.GetAddressBytes())
            {
                Notes  = notes,
                Expiry = expiry,
            };

            rec.Create();

            var ban = new IPBan(rec);

            AddIPBan(ban);
            return(ban);
        }
Ejemplo n.º 2
0
        public IPBan(IPBanRecord record)
        {
            Contract.Requires(record != null);

            Record = record;
        }