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); }
public IPBan(IPBanRecord record) { Contract.Requires(record != null); Record = record; }