Loading src/api/Controllers/LocationsController.cs +20 −0 Original line number Diff line number Diff line Loading @@ -121,4 +121,24 @@ public class LocationsController : ControllerBase return CreatedAtRoute("GetLocationVlanById", new { locationVlanId = mapping.LocationVlanId }, mapping); } // DELETE: /locations/2/vlans/4 [Authorize(Policy = Policies.CanEdit)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] [HttpDelete("{locationId:long}/vlans/{vlanId:long}", Name = "RemoveVlanFromLocation")] public async Task<IActionResult> RemoveVlanFromLocationAsync(long locationId, long vlanId) { LocationVlan? mapping = await _context.LocationVlans .Where(lv => lv.LocationId == locationId && lv.VlanId == vlanId) .FirstOrDefaultAsync(); if (mapping == null) return NotFound(); _context.LocationVlans.Remove(mapping); await _context.SaveChangesAsync(); return NoContent(); } } src/api/Controllers/PaloAltoFirewallsController.cs +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ public class PaloAltoFirewallsController : ControllerBase [HttpGet(Name = "GetAllPaloAltoFirewalls")] public async Task<IActionResult> GetAllAsync() { var result = await _context.PaloAltoFirewalls List<PaloAltoFirewall> result = await _context.PaloAltoFirewalls .Where(e => e.IsActive == true) .ToListAsync(); Loading src/infrastructure/Models/PaloAltoFirewallVlanEntityTypeConfiguration.cs +0 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ public class PaloAltoFirewallVlanEntityTypeConfiguration : IEntityTypeConfigurat builder.HasOne(e => e.Vlan) .WithMany() .HasForeignKey(e => e.VlanId); } } src/models/PaloAltoFirewallVlan.cs +0 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,4 @@ public class PaloAltoFirewallVlan : ICreatedAt, IAuditableEntity [JsonIgnore] public virtual Vlan? Vlan { get; set; } } Loading
src/api/Controllers/LocationsController.cs +20 −0 Original line number Diff line number Diff line Loading @@ -121,4 +121,24 @@ public class LocationsController : ControllerBase return CreatedAtRoute("GetLocationVlanById", new { locationVlanId = mapping.LocationVlanId }, mapping); } // DELETE: /locations/2/vlans/4 [Authorize(Policy = Policies.CanEdit)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] [HttpDelete("{locationId:long}/vlans/{vlanId:long}", Name = "RemoveVlanFromLocation")] public async Task<IActionResult> RemoveVlanFromLocationAsync(long locationId, long vlanId) { LocationVlan? mapping = await _context.LocationVlans .Where(lv => lv.LocationId == locationId && lv.VlanId == vlanId) .FirstOrDefaultAsync(); if (mapping == null) return NotFound(); _context.LocationVlans.Remove(mapping); await _context.SaveChangesAsync(); return NoContent(); } }
src/api/Controllers/PaloAltoFirewallsController.cs +1 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ public class PaloAltoFirewallsController : ControllerBase [HttpGet(Name = "GetAllPaloAltoFirewalls")] public async Task<IActionResult> GetAllAsync() { var result = await _context.PaloAltoFirewalls List<PaloAltoFirewall> result = await _context.PaloAltoFirewalls .Where(e => e.IsActive == true) .ToListAsync(); Loading
src/infrastructure/Models/PaloAltoFirewallVlanEntityTypeConfiguration.cs +0 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ public class PaloAltoFirewallVlanEntityTypeConfiguration : IEntityTypeConfigurat builder.HasOne(e => e.Vlan) .WithMany() .HasForeignKey(e => e.VlanId); } }
src/models/PaloAltoFirewallVlan.cs +0 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,4 @@ public class PaloAltoFirewallVlan : ICreatedAt, IAuditableEntity [JsonIgnore] public virtual Vlan? Vlan { get; set; } }