Commit 7e2daf91 authored by drnull03's avatar drnull03

Finished to json based api first commit

parents
,drnull,Gov-Pc,02.11.2025 08:56,file:///home/drnull/.config/libreoffice/4;
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.10">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.10">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
</ItemGroup>
</Project>

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BUSNOW", "BUSNOW.csproj", "{E0FD157E-BF73-4E41-82E1-A9B1113410D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E0FD157E-BF73-4E41-82E1-A9B1113410D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0FD157E-BF73-4E41-82E1-A9B1113410D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0FD157E-BF73-4E41-82E1-A9B1113410D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0FD157E-BF73-4E41-82E1-A9B1113410D6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {88D8D145-C9D7-46CD-BCD0-8A36C75F75EB}
EndGlobalSection
EndGlobal
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using BUSNOW.Data;
using BUSNOW.Models;
namespace BUSNOW.Controllers.Api
{
[ApiController]
[Route("api/[controller]")]
public class LinesController : ControllerBase
{
private readonly AppDbContext _context;
public LinesController(AppDbContext context)
{
_context = context;
}
// GET: api/lines
[HttpGet]
public async Task<IActionResult> GetLines()
{
var lines = await _context.Lines
.Include(x => x.Passengers)
.Include(x => x.Stops)
.ToListAsync();
return Ok(lines);
}
// GET: api/lines/5
[HttpGet("{id}")]
public async Task<IActionResult> GetLine(int id)
{
var line = await _context.Lines
.Include(x => x.Passengers)
.Include(x => x.Stops)
.FirstOrDefaultAsync(x => x.Id == id);
if (line == null)
return NotFound();
return Ok(line);
}
// POST: api/lines
[HttpPost]
public async Task<IActionResult> CreateLine([FromBody] Line line)
{
if (!ModelState.IsValid)
return BadRequest(ModelState);
_context.Lines.Add(line);
await _context.SaveChangesAsync();
return CreatedAtAction(nameof(GetLine), new { id = line.Id }, line);
}
// PUT: api/lines/5
[HttpPut("{id}")]
public async Task<IActionResult> UpdateLine(int id, [FromBody] Line line)
{
if (id != line.Id)
return BadRequest("ID mismatch");
_context.Entry(line).State = EntityState.Modified;
await _context.SaveChangesAsync();
return NoContent();
}
// DELETE: api/lines/5
[HttpDelete("{id}")]
public async Task<IActionResult> DeleteLine(int id)
{
var line = await _context.Lines.FindAsync(id);
if (line == null)
return NotFound();
_context.Lines.Remove(line);
await _context.SaveChangesAsync();
return NoContent();
}
}
}
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using BUSNOW.Data;
using BUSNOW.Models;
namespace BUSNOW.Controllers.Api
{
[ApiController]
[Route("api/[controller]")]
public class PassengersController : ControllerBase
{
private readonly AppDbContext _context;
public PassengersController(AppDbContext context)
{
_context = context;
}
// GET: api/passengers
[HttpGet]
public async Task<IActionResult> GetAll()
{
var items = await _context.Passengers.ToListAsync();
return Ok(items);
}
// GET: api/passengers/5
[HttpGet("{id}")]
public async Task<IActionResult> Get(int id)
{
var item = await _context.Passengers.FindAsync(id);
if (item == null)
return NotFound();
return Ok(item);
}
// POST: api/passengers
[HttpPost]
public async Task<IActionResult> Create([FromBody] Passenger passenger)
{
_context.Passengers.Add(passenger);
await _context.SaveChangesAsync();
return CreatedAtAction(nameof(Get), new { id = passenger.Id }, passenger);
}
// PUT: api/passengers/5
[HttpPut("{id}")]
public async Task<IActionResult> Update(int id, [FromBody] Passenger passenger)
{
if (id != passenger.Id)
return BadRequest("ID mismatch");
_context.Entry(passenger).State = EntityState.Modified;
await _context.SaveChangesAsync();
return NoContent();
}
// DELETE: api/passengers/5
[HttpDelete("{id}")]
public async Task<IActionResult> Delete(int id)
{
var item = await _context.Passengers.FindAsync(id);
if (item == null)
return NotFound();
_context.Passengers.Remove(item);
await _context.SaveChangesAsync();
return NoContent();
}
}
}
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using BUSNOW.Data;
using BUSNOW.Models;
namespace BUSNOW.Controllers.Api
{
[ApiController]
[Route("api/[controller]")]
public class StopsController : ControllerBase
{
private readonly AppDbContext _context;
public StopsController(AppDbContext context)
{
_context = context;
}
// GET: api/stops
[HttpGet]
public async Task<IActionResult> GetAll()
{
var items = await _context.Stops.ToListAsync();
return Ok(items);
}
// GET: api/stops/5
[HttpGet("{id}")]
public async Task<IActionResult> Get(int id)
{
var item = await _context.Stops.FindAsync(id);
if (item == null)
return NotFound();
return Ok(item);
}
// POST: api/stops
[HttpPost]
public async Task<IActionResult> Create([FromBody] Stop stop)
{
_context.Stops.Add(stop);
await _context.SaveChangesAsync();
return CreatedAtAction(nameof(Get), new { id = stop.StopId }, stop);
}
// PUT: api/stops/5
[HttpPut("{id}")]
public async Task<IActionResult> Update(int id, [FromBody] Stop stop)
{
if (id != stop.StopId)
return BadRequest("ID mismatch");
_context.Entry(stop).State = EntityState.Modified;
await _context.SaveChangesAsync();
return NoContent();
}
// DELETE: api/stops/5
[HttpDelete("{id}")]
public async Task<IActionResult> Delete(int id)
{
var item = await _context.Stops.FindAsync(id);
if (item == null)
return NotFound();
_context.Stops.Remove(item);
await _context.SaveChangesAsync();
return NoContent();
}
}
}
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using BUSNOW.Models;
namespace BUSNOW.Controllers;
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
public IActionResult Privacy()
{
return View();
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
using Microsoft.EntityFrameworkCore;
using BUSNOW.Models;
namespace BUSNOW.Data
{
public class AppDbContext : DbContext
{
public AppDbContext(DbContextOptions<AppDbContext> options)
: base(options) { }
public DbSet<Passenger> Passengers { get; set; }
public DbSet<Line> Lines { get; set; }
public DbSet<Stop> Stops { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Passenger>()
.HasOne<Line>() // No navigation property
.WithMany(l => l.Passengers)
.HasForeignKey(p => p.LineId)
.IsRequired();
// Stop -> Line
modelBuilder.Entity<Stop>()
.HasOne<Line>() // No navigation property
.WithMany(l => l.Stops)
.HasForeignKey(s => s.LineId)
.IsRequired();
}
}
}
// <auto-generated />
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20251101170500_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Student", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Students");
});
#pragma warning restore 612, 618
}
}
}
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BUSNOW.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Students",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Email = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Students", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Students");
}
}
}
// <auto-generated />
using System;
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20251101181620_InitialBusSchema")]
partial class InitialBusSchema
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DriverId")
.HasColumnType("int");
b.Property<int>("SupervisorId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Lines");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<DateTime>("RegisterDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("LineId");
b.ToTable("Passengers");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.Property<int>("StopId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StopId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("StopId");
b.HasIndex("LineId");
b.ToTable("Stops");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Passengers")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Stops")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Navigation("Passengers");
b.Navigation("Stops");
});
#pragma warning restore 612, 618
}
}
}
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BUSNOW.Migrations
{
/// <inheritdoc />
public partial class InitialBusSchema : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Students");
migrationBuilder.CreateTable(
name: "Lines",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
DriverId = table.Column<int>(type: "int", nullable: false),
SupervisorId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Lines", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Passengers",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
LineId = table.Column<int>(type: "int", nullable: false),
RegisterDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Passengers", x => x.Id);
table.ForeignKey(
name: "FK_Passengers_Lines_LineId",
column: x => x.LineId,
principalTable: "Lines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Stops",
columns: table => new
{
StopId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Title = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LineId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Stops", x => x.StopId);
table.ForeignKey(
name: "FK_Stops_Lines_LineId",
column: x => x.LineId,
principalTable: "Lines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Passengers_LineId",
table: "Passengers",
column: "LineId");
migrationBuilder.CreateIndex(
name: "IX_Stops_LineId",
table: "Stops",
column: "LineId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Passengers");
migrationBuilder.DropTable(
name: "Stops");
migrationBuilder.DropTable(
name: "Lines");
migrationBuilder.CreateTable(
name: "Students",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Email = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Students", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
}
}
// <auto-generated />
using System;
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20251103130558_AddOneToOneBusLine")]
partial class AddOneToOneBusLine
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Bus", b =>
{
b.Property<int>("BusId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("BusId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Plate")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("BusId");
b.HasIndex("LineId")
.IsUnique();
b.ToTable("Bus");
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DriverId")
.HasColumnType("int");
b.Property<int>("SupervisorId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Lines");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<DateTime>("RegisterDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("LineId");
b.ToTable("Passengers");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.Property<int>("StopId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StopId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("StopId");
b.HasIndex("LineId");
b.ToTable("Stops");
});
modelBuilder.Entity("BUSNOW.Models.Bus", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithOne("Bus")
.HasForeignKey("BUSNOW.Models.Bus", "LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Passengers")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Stops")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Navigation("Bus")
.IsRequired();
b.Navigation("Passengers");
b.Navigation("Stops");
});
#pragma warning restore 612, 618
}
}
}
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BUSNOW.Migrations
{
/// <inheritdoc />
public partial class AddOneToOneBusLine : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Bus",
columns: table => new
{
BusId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Plate = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
LineId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Bus", x => x.BusId);
table.ForeignKey(
name: "FK_Bus_Lines_LineId",
column: x => x.LineId,
principalTable: "Lines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Bus_LineId",
table: "Bus",
column: "LineId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Bus");
}
}
}
// <auto-generated />
using System;
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20251103131013_correctTheOneToOneRelationShip")]
partial class correctTheOneToOneRelationShip
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Bus", b =>
{
b.Property<int>("BusId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("BusId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Plate")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("BusId");
b.HasIndex("LineId")
.IsUnique();
b.ToTable("Buses");
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DriverId")
.HasColumnType("int");
b.Property<int>("SupervisorId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Lines");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<DateTime>("RegisterDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("LineId");
b.ToTable("Passengers");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.Property<int>("StopId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StopId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("StopId");
b.HasIndex("LineId");
b.ToTable("Stops");
});
modelBuilder.Entity("BUSNOW.Models.Bus", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithOne("Bus")
.HasForeignKey("BUSNOW.Models.Bus", "LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Passengers")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Stops")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Navigation("Bus")
.IsRequired();
b.Navigation("Passengers");
b.Navigation("Stops");
});
#pragma warning restore 612, 618
}
}
}
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BUSNOW.Migrations
{
/// <inheritdoc />
public partial class correctTheOneToOneRelationShip : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Bus_Lines_LineId",
table: "Bus");
migrationBuilder.DropPrimaryKey(
name: "PK_Bus",
table: "Bus");
migrationBuilder.RenameTable(
name: "Bus",
newName: "Buses");
migrationBuilder.RenameIndex(
name: "IX_Bus_LineId",
table: "Buses",
newName: "IX_Buses_LineId");
migrationBuilder.AddPrimaryKey(
name: "PK_Buses",
table: "Buses",
column: "BusId");
migrationBuilder.AddForeignKey(
name: "FK_Buses_Lines_LineId",
table: "Buses",
column: "LineId",
principalTable: "Lines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Buses_Lines_LineId",
table: "Buses");
migrationBuilder.DropPrimaryKey(
name: "PK_Buses",
table: "Buses");
migrationBuilder.RenameTable(
name: "Buses",
newName: "Bus");
migrationBuilder.RenameIndex(
name: "IX_Buses_LineId",
table: "Bus",
newName: "IX_Bus_LineId");
migrationBuilder.AddPrimaryKey(
name: "PK_Bus",
table: "Bus",
column: "BusId");
migrationBuilder.AddForeignKey(
name: "FK_Bus_Lines_LineId",
table: "Bus",
column: "LineId",
principalTable: "Lines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}
// <auto-generated />
using System;
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20251103185315_BusPropertiesMig")]
partial class BusPropertiesMig
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DriverId")
.HasColumnType("int");
b.Property<string>("DriverName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PlateNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("SupervisorId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Lines");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<DateTime>("RegisterDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("LineId");
b.ToTable("Passengers");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.Property<int>("StopId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StopId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("StopId");
b.HasIndex("LineId");
b.ToTable("Stops");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Passengers")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.HasOne("BUSNOW.Models.Line", "Line")
.WithMany("Stops")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Line");
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Navigation("Passengers");
b.Navigation("Stops");
});
#pragma warning restore 612, 618
}
}
}
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BUSNOW.Migrations
{
/// <inheritdoc />
public partial class BusPropertiesMig : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Buses");
migrationBuilder.AddColumn<string>(
name: "DriverName",
table: "Lines",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "PlateNumber",
table: "Lines",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DriverName",
table: "Lines");
migrationBuilder.DropColumn(
name: "PlateNumber",
table: "Lines");
migrationBuilder.CreateTable(
name: "Buses",
columns: table => new
{
BusId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
LineId = table.Column<int>(type: "int", nullable: false),
Plate = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Buses", x => x.BusId);
table.ForeignKey(
name: "FK_Buses_Lines_LineId",
column: x => x.LineId,
principalTable: "Lines",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Buses_LineId",
table: "Buses",
column: "LineId",
unique: true);
}
}
}
// <auto-generated />
using System;
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
[Migration("20251116203820_RemoveChildNavigation")]
partial class RemoveChildNavigation
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DriverId")
.HasColumnType("int");
b.Property<string>("DriverName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PlateNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("SupervisorId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Lines");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<DateTime>("RegisterDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("LineId");
b.ToTable("Passengers");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.Property<int>("StopId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StopId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("StopId");
b.HasIndex("LineId");
b.ToTable("Stops");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.HasOne("BUSNOW.Models.Line", null)
.WithMany("Passengers")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.HasOne("BUSNOW.Models.Line", null)
.WithMany("Stops")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Navigation("Passengers");
b.Navigation("Stops");
});
#pragma warning restore 612, 618
}
}
}
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BUSNOW.Migrations
{
/// <inheritdoc />
public partial class RemoveChildNavigation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}
// <auto-generated />
using System;
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BUSNOW.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DriverId")
.HasColumnType("int");
b.Property<string>("DriverName")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PlateNumber")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("SupervisorId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Lines");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
b.Property<bool>("IsActive")
.HasColumnType("tinyint(1)");
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<DateTime>("RegisterDate")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("LineId");
b.ToTable("Passengers");
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.Property<int>("StopId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("StopId"));
b.Property<int>("LineId")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("StopId");
b.HasIndex("LineId");
b.ToTable("Stops");
});
modelBuilder.Entity("BUSNOW.Models.Passenger", b =>
{
b.HasOne("BUSNOW.Models.Line", null)
.WithMany("Passengers")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BUSNOW.Models.Stop", b =>
{
b.HasOne("BUSNOW.Models.Line", null)
.WithMany("Stops")
.HasForeignKey("LineId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("BUSNOW.Models.Line", b =>
{
b.Navigation("Passengers");
b.Navigation("Stops");
});
#pragma warning restore 612, 618
}
}
}
namespace BUSNOW.Models;
public class ErrorViewModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
using System.Collections.Generic;
namespace BUSNOW.Models
{
public class Line
{
public int Id { get; set; }
public string Title { get; set; } = string.Empty;
public int DriverId { get; set; }
public int SupervisorId { get; set; }
public string PlateNumber {get;set;} = string.Empty;
public string DriverName {get;set;} = string.Empty;
// Relationships
public ICollection<Passenger> Passengers { get; set; } = new List<Passenger>();
public ICollection<Stop> Stops { get; set; } = new List<Stop>();
}
}
using System;
namespace BUSNOW.Models
{
public class Passenger
{
public int Id { get; set; }
public int LineId { get; set; }
public DateTime RegisterDate { get; set; }
public bool IsActive { get; set; }
// Navigation
//public Line? Line { get; set; } = null!;
}
}
namespace BUSNOW.Models
{
public class Stop
{
public int StopId { get; set; }
public string Title { get; set; } = string.Empty;
public int LineId { get; set; }
// Navigation
// public Line? Line { get; set; } = null!;
}
}
change DriverName To capacity
using BUSNOW.Data;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllersWithViews();
builder.Services.AddControllers();
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)));
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
// Enable attribute-routed API controllers
app.MapControllers();
// MVC default route
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.Run();
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:46437",
"sslPort": 44364
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5032",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7044;http://localhost:5032",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@{
ViewData["Title"] = "Home Page";
}
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - BUSNOW</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/BUSNOW.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">BUSNOW</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2025 - BUSNOW - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
a {
color: #0077cc;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
@using BUSNOW
@using BUSNOW.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = "_Layout";
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
{
"ConnectionStrings": {
"DefaultConnection": "server=localhost;database=hiast_db;user=drnull;password=changetheworld;"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
This diff is collapsed.
{
"runtimeOptions": {
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "8.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
\ No newline at end of file
{"ContentRoots":["/home/drnull/UNI/web/BUSNOW/wwwroot/","/home/drnull/UNI/web/BUSNOW/obj/Debug/net8.0/scopedcss/bundle/"],"Root":{"Children":{"css":{"Children":{"site.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"css/site.css"},"Patterns":null}},"Asset":null,"Patterns":null},"favicon.ico":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"favicon.ico"},"Patterns":null},"js":{"Children":{"site.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"js/site.js"},"Patterns":null}},"Asset":null,"Patterns":null},"lib":{"Children":{"bootstrap":{"Children":{"dist":{"Children":{"css":{"Children":{"bootstrap-grid.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.css"},"Patterns":null},"bootstrap-grid.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.css.map"},"Patterns":null},"bootstrap-grid.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.min.css"},"Patterns":null},"bootstrap-grid.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.min.css.map"},"Patterns":null},"bootstrap-grid.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.css"},"Patterns":null},"bootstrap-grid.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map"},"Patterns":null},"bootstrap-grid.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css"},"Patterns":null},"bootstrap-grid.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map"},"Patterns":null},"bootstrap-reboot.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.css"},"Patterns":null},"bootstrap-reboot.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.css.map"},"Patterns":null},"bootstrap-reboot.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.min.css"},"Patterns":null},"bootstrap-reboot.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.min.css.map"},"Patterns":null},"bootstrap-reboot.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.css"},"Patterns":null},"bootstrap-reboot.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map"},"Patterns":null},"bootstrap-reboot.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css"},"Patterns":null},"bootstrap-reboot.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map"},"Patterns":null},"bootstrap-utilities.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.css"},"Patterns":null},"bootstrap-utilities.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.css.map"},"Patterns":null},"bootstrap-utilities.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.min.css"},"Patterns":null},"bootstrap-utilities.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.min.css.map"},"Patterns":null},"bootstrap-utilities.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.css"},"Patterns":null},"bootstrap-utilities.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map"},"Patterns":null},"bootstrap-utilities.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css"},"Patterns":null},"bootstrap-utilities.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map"},"Patterns":null},"bootstrap.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.css"},"Patterns":null},"bootstrap.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.css.map"},"Patterns":null},"bootstrap.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.min.css"},"Patterns":null},"bootstrap.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.min.css.map"},"Patterns":null},"bootstrap.rtl.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.css"},"Patterns":null},"bootstrap.rtl.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.css.map"},"Patterns":null},"bootstrap.rtl.min.css":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.min.css"},"Patterns":null},"bootstrap.rtl.min.css.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/css/bootstrap.rtl.min.css.map"},"Patterns":null}},"Asset":null,"Patterns":null},"js":{"Children":{"bootstrap.bundle.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.js"},"Patterns":null},"bootstrap.bundle.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.js.map"},"Patterns":null},"bootstrap.bundle.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.min.js"},"Patterns":null},"bootstrap.bundle.min.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.bundle.min.js.map"},"Patterns":null},"bootstrap.esm.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.js"},"Patterns":null},"bootstrap.esm.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.js.map"},"Patterns":null},"bootstrap.esm.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.min.js"},"Patterns":null},"bootstrap.esm.min.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.esm.min.js.map"},"Patterns":null},"bootstrap.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.js"},"Patterns":null},"bootstrap.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.js.map"},"Patterns":null},"bootstrap.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.min.js"},"Patterns":null},"bootstrap.min.js.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/dist/js/bootstrap.min.js.map"},"Patterns":null}},"Asset":null,"Patterns":null}},"Asset":null,"Patterns":null},"LICENSE":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/bootstrap/LICENSE"},"Patterns":null}},"Asset":null,"Patterns":null},"jquery-validation-unobtrusive":{"Children":{"jquery.validate.unobtrusive.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"},"Patterns":null},"jquery.validate.unobtrusive.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"},"Patterns":null},"LICENSE.txt":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation-unobtrusive/LICENSE.txt"},"Patterns":null}},"Asset":null,"Patterns":null},"jquery-validation":{"Children":{"dist":{"Children":{"additional-methods.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/additional-methods.js"},"Patterns":null},"additional-methods.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/additional-methods.min.js"},"Patterns":null},"jquery.validate.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/jquery.validate.js"},"Patterns":null},"jquery.validate.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/dist/jquery.validate.min.js"},"Patterns":null}},"Asset":null,"Patterns":null},"LICENSE.md":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery-validation/LICENSE.md"},"Patterns":null}},"Asset":null,"Patterns":null},"jquery":{"Children":{"dist":{"Children":{"jquery.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/dist/jquery.js"},"Patterns":null},"jquery.min.js":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/dist/jquery.min.js"},"Patterns":null},"jquery.min.map":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/dist/jquery.min.map"},"Patterns":null}},"Asset":null,"Patterns":null},"LICENSE.txt":{"Children":null,"Asset":{"ContentRootIndex":0,"SubPath":"lib/jquery/LICENSE.txt"},"Patterns":null}},"Asset":null,"Patterns":null}},"Asset":null,"Patterns":null},"BUSNOW.styles.css":{"Children":null,"Asset":{"ContentRootIndex":1,"SubPath":"BUSNOW.styles.css"},"Patterns":null}},"Asset":null,"Patterns":[{"ContentRootIndex":0,"Pattern":"**","Depth":0}]}}
\ No newline at end of file
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
{
"ConnectionStrings": {
"DefaultConnection": "server=localhost;database=hiast_db;user=drnull;password=changetheworld;"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
This diff is collapsed.
{
"name": "clientapp",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.2.0",
"react-dom": "^19.2.0"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@vitejs/plugin-react": "^5.1.0",
"eslint": "^9.39.1",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"vite": "^7.2.2"
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment