Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
METrimble committed Feb 27, 2025
1 parent 5850bc4 commit 5c4e00a
Show file tree
Hide file tree
Showing 89 changed files with 75,321 additions and 0 deletions.
25 changes: 25 additions & 0 deletions MyCloset.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35312.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCloset", "MyCloset\MyCloset.csproj", "{36A46A14-C1A6-4474-9868-59A935CFC546}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{36A46A14-C1A6-4474-9868-59A935CFC546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36A46A14-C1A6-4474-9868-59A935CFC546}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36A46A14-C1A6-4474-9868-59A935CFC546}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36A46A14-C1A6-4474-9868-59A935CFC546}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {04DF7AD8-B378-406C-AED0-D1F62382F825}
EndGlobalSection
EndGlobal
32 changes: 32 additions & 0 deletions MyCloset/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Microsoft.AspNetCore.Mvc;
using MyCloset.Models;
using System.Diagnostics;

namespace MyCloset.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 });
}
}
}
28 changes: 28 additions & 0 deletions MyCloset/Controllers/MyClosetController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc;
using MyCloset.Data;
using Microsoft.EntityFrameworkCore;

namespace MyCloset.Controllers
{
public class MyClosetController : Controller
{
private readonly Context _context;

// Database context
public MyClosetController(Context context)
{
_context = context;
}

// Retrieve all clothing items from the database
// Use asynchronous action to retrieve data from the database
public async Task<IActionResult> Closet()
{
// Clothing Items database set
var ClothingItems = await _context.ClothingItems.ToListAsync();

// Wait until we get data back before returning the view
return View(ClothingItems);
}
}
}
16 changes: 16 additions & 0 deletions MyCloset/Data/Context.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Microsoft.EntityFrameworkCore;
using MyCloset.Models;

namespace MyCloset.Data
{
public class Context : DbContext
{
public Context() { }
public Context(DbContextOptions<Context> options)
: base(options)
{
}

public DbSet<ClothingItem> ClothingItems { get; set; }
}
}
57 changes: 57 additions & 0 deletions MyCloset/Migrations/20250222031825_Initial Migration.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions MyCloset/Migrations/20250222031825_Initial Migration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MyCloset.Migrations
{
/// <inheritdoc />
public partial class InitialMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ClothingItem",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
Type = table.Column<string>(type: "nvarchar(max)", nullable: false),
StackType = table.Column<int>(type: "int", nullable: false),
ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClothingItem", x => x.Id);
});
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ClothingItem");
}
}
}
57 changes: 57 additions & 0 deletions MyCloset/Migrations/20250224034843_Error 404.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions MyCloset/Migrations/20250224034843_Error 404.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MyCloset.Migrations
{
/// <inheritdoc />
public partial class Error404 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{

}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{

}
}
}
57 changes: 57 additions & 0 deletions MyCloset/Migrations/20250225053753_Error Credential.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions MyCloset/Migrations/20250225053753_Error Credential.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MyCloset.Migrations
{
/// <inheritdoc />
public partial class ErrorCredential : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_ClothingItem",
table: "ClothingItem");

migrationBuilder.RenameTable(
name: "ClothingItem",
newName: "ClothingItems");

migrationBuilder.AddPrimaryKey(
name: "PK_ClothingItems",
table: "ClothingItems",
column: "Id");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_ClothingItems",
table: "ClothingItems");

migrationBuilder.RenameTable(
name: "ClothingItems",
newName: "ClothingItem");

migrationBuilder.AddPrimaryKey(
name: "PK_ClothingItem",
table: "ClothingItem",
column: "Id");
}
}
}
Loading

0 comments on commit 5c4e00a

Please sign in to comment.