Exemple #1
0
        public static void BlockIp(BlockModel input)
        {
            var dbModel = new BlockList
            {
                BlockedIp  = input.BlockedIp,
                Explicit   = input.Explicit,
                Reason     = input.Reason,
                Expiration = input.BlockType.ToLower() == "timeout" ? DateTime.UtcNow.AddDays(1).Date : DateTime.MaxValue
            };

            DbAccess.BlockIp(dbModel);
        }