public async Task <dynamic> banMac([FromBody] BanRequestDTO request) { DateTime now = DateTime.UtcNow; BannedMac newBan = new BannedMac() { MacAddress = request.MacAddress, FromDt = now, ToDt = request.ToDt }; db.BannedMac.Add(newBan); db.SaveChanges(); return(Ok("Mac Banned")); }
public async Task <dynamic> banIp([FromBody] BanRequestDTO request) { DateTime now = DateTime.UtcNow; BannedIp newBan = new BannedIp() { IpAddress = request.IpAddress, FromDt = now, ToDt = request.ToDt }; db.BannedIp.Add(newBan); db.SaveChanges(); return(Ok("Ip Banned")); }