Upload project.
This commit is contained in:
105
ThAmCo-Products/ThAmCo.Products/Controllers/AccountController.cs
Normal file
105
ThAmCo-Products/ThAmCo.Products/Controllers/AccountController.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using IdentityModel.Client;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ThAmCo.Products.Models;
|
||||
|
||||
namespace ThAmCo.Products.Controllers
|
||||
{
|
||||
public class AccountController : Controller
|
||||
{
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
|
||||
public AccountController(IHttpClientFactory clientFactory)
|
||||
{
|
||||
_clientFactory = clientFactory;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> Login()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Login([FromForm] LoginModel model)
|
||||
{
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
|
||||
var disco = await client.GetDiscoveryDocumentAsync("https://localhost:43389");
|
||||
var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest
|
||||
{
|
||||
Address = disco.TokenEndpoint,
|
||||
ClientId = "my_web_app",
|
||||
ClientSecret = "secret",
|
||||
|
||||
UserName = model.Email,
|
||||
Password = model.Password
|
||||
});
|
||||
|
||||
if (tokenResponse.IsError)
|
||||
return View();
|
||||
|
||||
var userInfoResponse = await client.GetUserInfoAsync(new UserInfoRequest
|
||||
{
|
||||
Address = disco.UserInfoEndpoint,
|
||||
Token = tokenResponse.AccessToken
|
||||
});
|
||||
|
||||
if (userInfoResponse.IsError)
|
||||
return View();
|
||||
|
||||
var claimsIdentity = new ClaimsIdentity(userInfoResponse.Claims, "Cookies");
|
||||
var claimsPrincipal = new ClaimsPrincipal(claimsIdentity);
|
||||
|
||||
var tokensToStore = new AuthenticationToken[]
|
||||
{
|
||||
new AuthenticationToken { Name = "access_token", Value = tokenResponse.AccessToken }
|
||||
};
|
||||
var authProperties = new AuthenticationProperties();
|
||||
authProperties.StoreTokens(tokensToStore);
|
||||
|
||||
await HttpContext.SignInAsync("Cookies", claimsPrincipal, authProperties);
|
||||
|
||||
return LocalRedirect("/");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public async Task<IActionResult> Logout()
|
||||
{
|
||||
await HttpContext.SignOutAsync("Cookies");
|
||||
return Ok("Signed Out");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public IActionResult Authed()
|
||||
{
|
||||
return Ok("Authed");
|
||||
}
|
||||
|
||||
[Authorize(Policy = "StaffOnly")]
|
||||
public IActionResult StaffAuthed()
|
||||
{
|
||||
return Ok("Authed");
|
||||
}
|
||||
|
||||
public IActionResult AccessDenied()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
private HttpClient GetHttpClient(string s)
|
||||
{
|
||||
return _clientFactory.CreateClient(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ThAmCo.Products.Models;
|
||||
|
||||
namespace ThAmCo.Products.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using ThAmCo.Products.Data;
|
||||
using ThAmCo.Products.Data.ProductsContext;
|
||||
using ThAmCo.Products.Models.DTOs;
|
||||
using ThAmCo.Products.Models.ViewModels;
|
||||
|
||||
namespace ThAmCo.Products.Controllers
|
||||
{
|
||||
public class ProductsController : Controller
|
||||
{
|
||||
private readonly IProductsContext _context;
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
|
||||
public HttpClient HttpClient { get; set; }
|
||||
|
||||
public ProductsController(IProductsContext context, IHttpClientFactory clientFactory)
|
||||
{
|
||||
_context = context;
|
||||
_clientFactory = clientFactory;
|
||||
}
|
||||
|
||||
// GET: Products
|
||||
//Auth here?
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> Index(double? PriceLow, double? PriceHigh, string Name, string Description, int BrandId = 0, int CategoryId = 0)
|
||||
{
|
||||
var authenticated = false;
|
||||
|
||||
try
|
||||
{
|
||||
var authentication = await HttpContext.AuthenticateAsync();
|
||||
authenticated = authentication.Succeeded;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
var products = await _context.GetAllActive();
|
||||
|
||||
if (BrandId != 0)
|
||||
products = products.Where(p => p.BrandId == BrandId).ToList();
|
||||
if (CategoryId != 0)
|
||||
products = products.Where(p => p.CategoryId == CategoryId).ToList();
|
||||
|
||||
if (!String.IsNullOrEmpty(Name))
|
||||
products = products.Where(p => p.Name.ToLower().Contains(Name.ToLower())).ToList();
|
||||
if (!String.IsNullOrEmpty(Description))
|
||||
products = products.Where(p => p.Description.Contains(Description)).ToList();
|
||||
|
||||
var productsWithPriceStock = new List<ProductsPriceStockModel>();
|
||||
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
var response = await client.GetAsync("https://localhost:44385/stock/ProductStocks");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var objectResult = await response.Content.ReadAsAsync<List<MultipleStockDTO>>();
|
||||
foreach (var t in products)
|
||||
{
|
||||
int? stock = null;
|
||||
if (authenticated)
|
||||
stock = objectResult.FirstOrDefault(or => or.ProductStock.ProductId == t.Id).ProductStock.Stock;
|
||||
productsWithPriceStock.Add(new ProductsPriceStockModel
|
||||
{
|
||||
Product = t,
|
||||
Price = objectResult.FirstOrDefault(or => or.ProductStock.ProductId == t.Id).Price.ProductPrice,
|
||||
Stock = stock
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
productsWithPriceStock.AddRange(products.Select(p => new ProductsPriceStockModel { Product = p, Price = null, Stock = null }));
|
||||
|
||||
var productIndex = new ProductsIndexModel
|
||||
{
|
||||
Name = Name ?? "",
|
||||
Description = Description ?? "",
|
||||
Products = productsWithPriceStock,
|
||||
BrandId = BrandId,
|
||||
CategoryId = CategoryId
|
||||
};
|
||||
|
||||
var selectListBrands = new List<Brand> { new Brand { Id = 0, Name = "All Brands" } };
|
||||
selectListBrands.AddRange(await _context.GetBrandsAsync());
|
||||
var selectListCategories = new List<Category> { new Category { Id = 0, Name = "All Categories" } };
|
||||
selectListCategories.AddRange(await _context.GetCategoriesAsync());
|
||||
|
||||
ViewData["BrandList"] = new SelectList(selectListBrands, "Id", "Name");
|
||||
ViewData["CategoryList"] = new SelectList(selectListCategories, "Id", "Name");
|
||||
|
||||
return View(productIndex);
|
||||
}
|
||||
|
||||
// GET: Products/Details/5
|
||||
public async Task<IActionResult> Details(int id)
|
||||
{
|
||||
if (id <= 0)
|
||||
return NotFound();
|
||||
|
||||
var product = await _context.GetProductAsync(id);
|
||||
|
||||
if (product == null)
|
||||
return NotFound();
|
||||
|
||||
var client = GetHttpClient("ReviewRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
var objectResult = new List<ReviewDto>();
|
||||
HttpResponseMessage response = null;
|
||||
try
|
||||
{
|
||||
response = await client.GetAsync("https://localhost:44367/reviews/GetReviewProduct?prodid=" + id);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (response != null && response.IsSuccessStatusCode)
|
||||
{
|
||||
objectResult = await response.Content.ReadAsAsync<List<ReviewDto>>();
|
||||
}
|
||||
|
||||
return View(new DetailsWithReviewsModelcs { Product = product, Reviews = objectResult });
|
||||
}
|
||||
|
||||
// GET: Products/Delete/5
|
||||
public async Task<IActionResult> Delete(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
return NotFound();
|
||||
|
||||
var product = await _context.GetProductAsync(id ?? 0);
|
||||
|
||||
if (product == null)
|
||||
return NotFound();
|
||||
|
||||
return View(product);
|
||||
}
|
||||
|
||||
// POST: Products/Delete/5
|
||||
[Authorize]
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(int id)
|
||||
{
|
||||
var product = await _context.GetProductAsync(id);
|
||||
_context.SoftDeleteProductAsync(product);
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<Product>> GetProduct(int id)
|
||||
{
|
||||
return Ok(await _context.GetProductAsync(id));
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<Product>>> GetAllProducts()
|
||||
{
|
||||
return Ok(await _context.GetAllActive());
|
||||
}
|
||||
|
||||
private bool ProductExists(int id)
|
||||
{
|
||||
return _context.GetAll().Result.Any(e => e.Id == id);
|
||||
}
|
||||
|
||||
private HttpClient GetHttpClient(string s)
|
||||
{
|
||||
if (_clientFactory == null && HttpClient != null) return HttpClient;
|
||||
|
||||
return _clientFactory.CreateClient(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
ThAmCo-Products/ThAmCo.Products/Data/Brand.cs
Normal file
10
ThAmCo-Products/ThAmCo.Products/Data/Brand.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace ThAmCo.Products.Data
|
||||
{
|
||||
public class Brand
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int AvailableProductCount { get; set; }
|
||||
}
|
||||
}
|
||||
9
ThAmCo-Products/ThAmCo.Products/Data/Category.cs
Normal file
9
ThAmCo-Products/ThAmCo.Products/Data/Category.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace ThAmCo.Products.Data
|
||||
{
|
||||
public class Category
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int AvailableProductCount { get; set; }
|
||||
}
|
||||
}
|
||||
88
ThAmCo-Products/ThAmCo.Products/Data/Migrations/20191105145333_InitialCreate.Designer.cs
generated
Normal file
88
ThAmCo-Products/ThAmCo.Products/Data/Migrations/20191105145333_InitialCreate.Designer.cs
generated
Normal file
@@ -0,0 +1,88 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Products.Data;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ProductsDbContext))]
|
||||
[Migration("20191105145333_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Brand", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Brands");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Category", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Category");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int?>("BrandId");
|
||||
|
||||
b.Property<int?>("CategoryId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BrandId");
|
||||
|
||||
b.HasIndex("CategoryId");
|
||||
|
||||
b.ToTable("Products");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.HasOne("ThAmCo.Products.Data.Brand", "Brand")
|
||||
.WithMany()
|
||||
.HasForeignKey("BrandId");
|
||||
|
||||
b.HasOne("ThAmCo.Products.Data.Category", "Category")
|
||||
.WithMany()
|
||||
.HasForeignKey("CategoryId");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Brands",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Brands", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Category",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Category", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Products",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
Name = table.Column<string>(nullable: true),
|
||||
Description = table.Column<string>(nullable: true),
|
||||
BrandId = table.Column<int>(nullable: true),
|
||||
CategoryId = table.Column<int>(nullable: true),
|
||||
Active = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Products", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Products_Brands_BrandId",
|
||||
column: x => x.BrandId,
|
||||
principalTable: "Brands",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_Products_Category_CategoryId",
|
||||
column: x => x.CategoryId,
|
||||
principalTable: "Category",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Products_BrandId",
|
||||
table: "Products",
|
||||
column: "BrandId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Products_CategoryId",
|
||||
table: "Products",
|
||||
column: "CategoryId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Products");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Brands");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Category");
|
||||
}
|
||||
}
|
||||
}
|
||||
188
ThAmCo-Products/ThAmCo.Products/Data/Migrations/20191107105050_InitialProductTestData.Designer.cs
generated
Normal file
188
ThAmCo-Products/ThAmCo.Products/Data/Migrations/20191107105050_InitialProductTestData.Designer.cs
generated
Normal file
@@ -0,0 +1,188 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Products.Data;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ProductsDbContext))]
|
||||
[Migration("20191107105050_InitialProductTestData")]
|
||||
partial class InitialProductTestData
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Brand", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Brands");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Name = "Brand 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Name = "Brand 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Name = "Brand 3"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Category", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Category");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Name = "Category 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Name = "Category 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Name = "Category 3"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int>("BrandId");
|
||||
|
||||
b.Property<int>("CategoryId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BrandId");
|
||||
|
||||
b.HasIndex("CategoryId");
|
||||
|
||||
b.ToTable("Products");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 1.",
|
||||
Name = "Product 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
BrandId = 2,
|
||||
CategoryId = 3,
|
||||
Description = "Description of product 2.",
|
||||
Name = "Product 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Active = true,
|
||||
BrandId = 3,
|
||||
CategoryId = 1,
|
||||
Description = "Description of product 3.",
|
||||
Name = "Product 3"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 4.",
|
||||
Name = "Product 4"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Active = true,
|
||||
BrandId = 2,
|
||||
CategoryId = 3,
|
||||
Description = "Description of product 5.",
|
||||
Name = "Product 5"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Active = true,
|
||||
BrandId = 3,
|
||||
CategoryId = 1,
|
||||
Description = "Description of product 6.",
|
||||
Name = "Product 6"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 7.",
|
||||
Name = "Product 7"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.HasOne("ThAmCo.Products.Data.Brand", "Brand")
|
||||
.WithMany()
|
||||
.HasForeignKey("BrandId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("ThAmCo.Products.Data.Category", "Category")
|
||||
.WithMany()
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
public partial class InitialProductTestData : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Products_Brands_BrandId",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Products_Category_CategoryId",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "CategoryId",
|
||||
table: "Products",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "BrandId",
|
||||
table: "Products",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Brands",
|
||||
columns: new[] { "Id", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Brand 1" },
|
||||
{ 2, "Brand 2" },
|
||||
{ 3, "Brand 3" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Category",
|
||||
columns: new[] { "Id", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Category 1" },
|
||||
{ 2, "Category 2" },
|
||||
{ 3, "Category 3" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Products",
|
||||
columns: new[] { "Id", "Active", "BrandId", "CategoryId", "Description", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 3, true, 3, 1, "Description of product 3.", "Product 3" },
|
||||
{ 6, true, 3, 1, "Description of product 6.", "Product 6" },
|
||||
{ 1, true, 1, 2, "Description of product 1.", "Product 1" },
|
||||
{ 4, true, 1, 2, "Description of product 4.", "Product 4" },
|
||||
{ 7, true, 1, 2, "Description of product 7.", "Product 7" },
|
||||
{ 2, true, 2, 3, "Description of product 2.", "Product 2" },
|
||||
{ 5, true, 2, 3, "Description of product 5.", "Product 5" }
|
||||
});
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Products_Brands_BrandId",
|
||||
table: "Products",
|
||||
column: "BrandId",
|
||||
principalTable: "Brands",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Products_Category_CategoryId",
|
||||
table: "Products",
|
||||
column: "CategoryId",
|
||||
principalTable: "Category",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Products_Brands_BrandId",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Products_Category_CategoryId",
|
||||
table: "Products");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 4);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 5);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 6);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Products",
|
||||
keyColumn: "Id",
|
||||
keyValue: 7);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Brands",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Brands",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Brands",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Category",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Category",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Category",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "CategoryId",
|
||||
table: "Products",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int));
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "BrandId",
|
||||
table: "Products",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int));
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Products_Brands_BrandId",
|
||||
table: "Products",
|
||||
column: "BrandId",
|
||||
principalTable: "Brands",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Products_Category_CategoryId",
|
||||
table: "Products",
|
||||
column: "CategoryId",
|
||||
principalTable: "Category",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
203
ThAmCo-Products/ThAmCo.Products/Data/Migrations/20191223014356_NewBrandAndCategoryObjects.Designer.cs
generated
Normal file
203
ThAmCo-Products/ThAmCo.Products/Data/Migrations/20191223014356_NewBrandAndCategoryObjects.Designer.cs
generated
Normal file
@@ -0,0 +1,203 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Products.Data;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ProductsDbContext))]
|
||||
[Migration("20191223014356_NewBrandAndCategoryObjects")]
|
||||
partial class NewBrandAndCategoryObjects
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Brand", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("AvailableProductCount");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Brands");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AvailableProductCount = 3,
|
||||
Description = "Description 1",
|
||||
Name = "Brand 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
AvailableProductCount = 2,
|
||||
Description = "Description 2",
|
||||
Name = "Brand 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
AvailableProductCount = 3,
|
||||
Description = "Description 3",
|
||||
Name = "Brand 3"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Category", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("AvailableProductCount");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Category");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AvailableProductCount = 4,
|
||||
Name = "Category 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
AvailableProductCount = 3,
|
||||
Name = "Category 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
AvailableProductCount = 2,
|
||||
Name = "Category 3"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int>("BrandId");
|
||||
|
||||
b.Property<int>("CategoryId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BrandId");
|
||||
|
||||
b.HasIndex("CategoryId");
|
||||
|
||||
b.ToTable("Products");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 1.",
|
||||
Name = "Product 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
BrandId = 2,
|
||||
CategoryId = 3,
|
||||
Description = "Description of product 2.",
|
||||
Name = "Product 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Active = true,
|
||||
BrandId = 3,
|
||||
CategoryId = 1,
|
||||
Description = "Description of product 3.",
|
||||
Name = "Product 3"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 4.",
|
||||
Name = "Product 4"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Active = true,
|
||||
BrandId = 2,
|
||||
CategoryId = 3,
|
||||
Description = "Description of product 5.",
|
||||
Name = "Product 5"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Active = true,
|
||||
BrandId = 3,
|
||||
CategoryId = 1,
|
||||
Description = "Description of product 6.",
|
||||
Name = "Product 6"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 7.",
|
||||
Name = "Product 7"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.HasOne("ThAmCo.Products.Data.Brand", "Brand")
|
||||
.WithMany()
|
||||
.HasForeignKey("BrandId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("ThAmCo.Products.Data.Category", "Category")
|
||||
.WithMany()
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
public partial class NewBrandAndCategoryObjects : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "AvailableProductCount",
|
||||
table: "Category",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "AvailableProductCount",
|
||||
table: "Brands",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Description",
|
||||
table: "Brands",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Brands",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
columns: new[] { "AvailableProductCount", "Description" },
|
||||
values: new object[] { 3, "Description 1" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Brands",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
columns: new[] { "AvailableProductCount", "Description" },
|
||||
values: new object[] { 2, "Description 2" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Brands",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
columns: new[] { "AvailableProductCount", "Description" },
|
||||
values: new object[] { 3, "Description 3" });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Category",
|
||||
keyColumn: "Id",
|
||||
keyValue: 1,
|
||||
column: "AvailableProductCount",
|
||||
value: 4);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Category",
|
||||
keyColumn: "Id",
|
||||
keyValue: 2,
|
||||
column: "AvailableProductCount",
|
||||
value: 3);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "Category",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3,
|
||||
column: "AvailableProductCount",
|
||||
value: 2);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AvailableProductCount",
|
||||
table: "Category");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AvailableProductCount",
|
||||
table: "Brands");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Description",
|
||||
table: "Brands");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Products.Data;
|
||||
|
||||
namespace ThAmCo.Products.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ProductsDbContext))]
|
||||
partial class ProductsDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Brand", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("AvailableProductCount");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Brands");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AvailableProductCount = 3,
|
||||
Description = "Description 1",
|
||||
Name = "Brand 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
AvailableProductCount = 2,
|
||||
Description = "Description 2",
|
||||
Name = "Brand 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
AvailableProductCount = 3,
|
||||
Description = "Description 3",
|
||||
Name = "Brand 3"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Category", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("AvailableProductCount");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Category");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
AvailableProductCount = 4,
|
||||
Name = "Category 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
AvailableProductCount = 3,
|
||||
Name = "Category 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
AvailableProductCount = 2,
|
||||
Name = "Category 3"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int>("BrandId");
|
||||
|
||||
b.Property<int>("CategoryId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("BrandId");
|
||||
|
||||
b.HasIndex("CategoryId");
|
||||
|
||||
b.ToTable("Products");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 1.",
|
||||
Name = "Product 1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Active = true,
|
||||
BrandId = 2,
|
||||
CategoryId = 3,
|
||||
Description = "Description of product 2.",
|
||||
Name = "Product 2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Active = true,
|
||||
BrandId = 3,
|
||||
CategoryId = 1,
|
||||
Description = "Description of product 3.",
|
||||
Name = "Product 3"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 4.",
|
||||
Name = "Product 4"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Active = true,
|
||||
BrandId = 2,
|
||||
CategoryId = 3,
|
||||
Description = "Description of product 5.",
|
||||
Name = "Product 5"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Active = true,
|
||||
BrandId = 3,
|
||||
CategoryId = 1,
|
||||
Description = "Description of product 6.",
|
||||
Name = "Product 6"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Active = true,
|
||||
BrandId = 1,
|
||||
CategoryId = 2,
|
||||
Description = "Description of product 7.",
|
||||
Name = "Product 7"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Products.Data.Product", b =>
|
||||
{
|
||||
b.HasOne("ThAmCo.Products.Data.Brand", "Brand")
|
||||
.WithMany()
|
||||
.HasForeignKey("BrandId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
b.HasOne("ThAmCo.Products.Data.Category", "Category")
|
||||
.WithMany()
|
||||
.HasForeignKey("CategoryId")
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
14
ThAmCo-Products/ThAmCo.Products/Data/Product.cs
Normal file
14
ThAmCo-Products/ThAmCo.Products/Data/Product.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace ThAmCo.Products.Data
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int BrandId { get; set; }
|
||||
public Brand Brand { get; set; }
|
||||
public int CategoryId { get; set; }
|
||||
public Category Category { get; set; }
|
||||
public bool Active { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Products.Data.ProductsContext
|
||||
{
|
||||
public interface IProductsContext
|
||||
{
|
||||
Task<IEnumerable<Product>> GetAll();
|
||||
Task<IEnumerable<Product>> GetAllActive();
|
||||
Task<Product> GetProductAsync(int id);
|
||||
void AddProductAsync(Product product);
|
||||
void SoftDeleteProductAsync(Product product = null, int? id = null);
|
||||
Task<IEnumerable<Brand>> GetBrandsAsync();
|
||||
Task<IEnumerable<Category>> GetCategoriesAsync();
|
||||
void SaveAndUpdateContext();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Products.Data.ProductsContext
|
||||
{
|
||||
public class MockProductsContext : IProductsContext
|
||||
{
|
||||
private readonly List<Product> _products;
|
||||
private List<Brand> _brands;
|
||||
private List<Category> _categories;
|
||||
|
||||
public MockProductsContext(List<Product> products, List<Brand> brands, List<Category> categories)
|
||||
{
|
||||
_products = products;
|
||||
_brands = brands;
|
||||
_categories = categories;
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Product>> GetAll()
|
||||
{
|
||||
return Task.FromResult(_products.AsEnumerable());
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Product>> GetAllActive()
|
||||
{
|
||||
return Task.FromResult(_products.Where(p => p.Active));
|
||||
}
|
||||
|
||||
public Task<Product> GetProductAsync(int id)
|
||||
{
|
||||
return Task.FromResult(_products.FirstOrDefault(p => p.Id == id));
|
||||
}
|
||||
|
||||
public void AddProductAsync(Product product)
|
||||
{
|
||||
_products.Add(product);
|
||||
}
|
||||
|
||||
public void SoftDeleteProductAsync(Product product = null, int? id = null)
|
||||
{
|
||||
var chosenId = 0;
|
||||
if (product == null && id != null)
|
||||
chosenId = id ?? 0;
|
||||
if (product != null && id == null)
|
||||
chosenId = product.Id;
|
||||
var productFromList = _products.FirstOrDefault(p => p.Id == chosenId);
|
||||
if (productFromList != null)
|
||||
{
|
||||
_products.Remove(product);
|
||||
_products.Add(product);
|
||||
}
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Brand>> GetBrandsAsync()
|
||||
{
|
||||
return Task.FromResult(_brands.AsEnumerable());
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Category>> GetCategoriesAsync()
|
||||
{
|
||||
return Task.FromResult(_categories.AsEnumerable());
|
||||
}
|
||||
|
||||
public void SaveAndUpdateContext()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ThAmCo.Products.Data.ProductsContext
|
||||
{
|
||||
public class ProductsContext : IProductsContext
|
||||
{
|
||||
private readonly ProductsDbContext _context;
|
||||
|
||||
public ProductsContext(ProductsDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Product>> GetAll()
|
||||
{
|
||||
return await _context.Products.Include(p => p.Category).Include(p => p.Brand).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Product>> GetAllActive()
|
||||
{
|
||||
return await _context.Products.Where(p => p.Active).Include(p => p.Category).Include(p => p.Brand).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<Product> GetProductAsync(int id)
|
||||
{
|
||||
return await _context.Products.FirstOrDefaultAsync(p => p.Id == id);
|
||||
}
|
||||
|
||||
public void AddProductAsync(Product product)
|
||||
{
|
||||
_context.Add(product);
|
||||
SaveAndUpdateContext();
|
||||
}
|
||||
|
||||
public async void SoftDeleteProductAsync(Product product = null, int? id = null)
|
||||
{
|
||||
if (product != null)
|
||||
{
|
||||
product.Active = false;
|
||||
_context.Update(product);
|
||||
SaveAndUpdateContext();
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == null || id <= 0) return;
|
||||
var productToChange = await _context.Products.FirstOrDefaultAsync(p => p.Id == id);
|
||||
if (productToChange != null)
|
||||
{
|
||||
productToChange.Active = false;
|
||||
_context.Update(productToChange);
|
||||
SaveAndUpdateContext();
|
||||
}
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Brand>> GetBrandsAsync()
|
||||
{
|
||||
return Task.FromResult(_context.Brands.AsEnumerable());
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Category>> GetCategoriesAsync()
|
||||
{
|
||||
return Task.FromResult(_context.Category.AsEnumerable());
|
||||
}
|
||||
|
||||
public async void SaveAndUpdateContext()
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
72
ThAmCo-Products/ThAmCo.Products/Data/ProductsDbContext.cs
Normal file
72
ThAmCo-Products/ThAmCo.Products/Data/ProductsDbContext.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ThAmCo.Products.Data
|
||||
{
|
||||
public class ProductsDbContext : DbContext
|
||||
{
|
||||
public DbSet<Product> Products { get; set; }
|
||||
public DbSet<Brand> Brands { get; set; }
|
||||
public DbSet<Category> Category { get; set; }
|
||||
|
||||
private IHostingEnvironment HostEnv { get; }
|
||||
|
||||
public ProductsDbContext(DbContextOptions<ProductsDbContext> options, IHostingEnvironment env) : base(options)
|
||||
{
|
||||
HostEnv = env;
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder builder)
|
||||
{
|
||||
base.OnConfiguring(builder);
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
builder.Entity<Brand>()
|
||||
.HasKey(b => b.Id);
|
||||
|
||||
builder.Entity<Category>()
|
||||
.HasKey(c => c.Id);
|
||||
|
||||
builder.Entity<Product>()
|
||||
.HasOne(b => b.Brand);
|
||||
|
||||
builder.Entity<Product>()
|
||||
.HasOne(c => c.Category);
|
||||
|
||||
builder.Entity<Product>()
|
||||
.HasKey(p => p.Id);
|
||||
|
||||
if (HostEnv != null && HostEnv.IsDevelopment())
|
||||
{
|
||||
builder.Entity<Brand>()
|
||||
.HasData(
|
||||
new Brand { Id = 1, Name = "Brand 1", Description = "Description 1", AvailableProductCount = 3 },
|
||||
new Brand { Id = 2, Name = "Brand 2", Description = "Description 2", AvailableProductCount = 2 },
|
||||
new Brand { Id = 3, Name = "Brand 3", Description = "Description 3", AvailableProductCount = 3 }
|
||||
);
|
||||
|
||||
builder.Entity<Category>()
|
||||
.HasData(
|
||||
new Category { Id = 1, Name = "Category 1", AvailableProductCount = 4 },
|
||||
new Category { Id = 2, Name = "Category 2", AvailableProductCount = 3 },
|
||||
new Category { Id = 3, Name = "Category 3", AvailableProductCount = 2 }
|
||||
);
|
||||
|
||||
builder.Entity<Product>()
|
||||
.HasData(
|
||||
new Product { Id = 1, Name = "Product 1", Description = "Description of product 1.", BrandId = 1, CategoryId = 2, Active = true },
|
||||
new Product { Id = 2, Name = "Product 2", Description = "Description of product 2.", BrandId = 2, CategoryId = 3, Active = true },
|
||||
new Product { Id = 3, Name = "Product 3", Description = "Description of product 3.", BrandId = 3, CategoryId = 1, Active = true },
|
||||
new Product { Id = 4, Name = "Product 4", Description = "Description of product 4.", BrandId = 1, CategoryId = 2, Active = true },
|
||||
new Product { Id = 5, Name = "Product 5", Description = "Description of product 5.", BrandId = 2, CategoryId = 3, Active = true },
|
||||
new Product { Id = 6, Name = "Product 6", Description = "Description of product 6.", BrandId = 3, CategoryId = 1, Active = true },
|
||||
new Product { Id = 7, Name = "Product 7", Description = "Description of product 7.", BrandId = 1, CategoryId = 2, Active = true }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ThAmCo.Products.Models.DTOs
|
||||
{
|
||||
public class FromSingleStockDTO
|
||||
{
|
||||
public int ProductID { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public double Price { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ThAmCo.Products.Models.DTOs
|
||||
{
|
||||
public class MultipleStockDTO
|
||||
{
|
||||
public ProductStockDTO ProductStock { get; set; }
|
||||
public PriceDTO Price { get; set; }
|
||||
}
|
||||
}
|
||||
12
ThAmCo-Products/ThAmCo.Products/Models/DTOs/PriceDTO.cs
Normal file
12
ThAmCo-Products/ThAmCo.Products/Models/DTOs/PriceDTO.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace ThAmCo.Products.Models.DTOs
|
||||
{
|
||||
public class PriceDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ProductStockId { get; set; }
|
||||
public double ProductPrice { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ThAmCo.Products.Models.DTOs
|
||||
{
|
||||
public class ProductStockDTO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public int PriceId { get; set; }
|
||||
}
|
||||
}
|
||||
16
ThAmCo-Products/ThAmCo.Products/Models/DTOs/ReviewDto.cs
Normal file
16
ThAmCo-Products/ThAmCo.Products/Models/DTOs/ReviewDto.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Products.Models.DTOs
|
||||
{
|
||||
public class ReviewDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int PurchaseId { get; set; }
|
||||
public bool IsVisible { get; set; }
|
||||
public int Rating { get; set; }
|
||||
public string Content { get; set; }
|
||||
}
|
||||
}
|
||||
11
ThAmCo-Products/ThAmCo.Products/Models/ErrorViewModel.cs
Normal file
11
ThAmCo-Products/ThAmCo.Products/Models/ErrorViewModel.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace ThAmCo.Products.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
15
ThAmCo-Products/ThAmCo.Products/Models/LoginModel.cs
Normal file
15
ThAmCo-Products/ThAmCo.Products/Models/LoginModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Products.Models
|
||||
{
|
||||
public class LoginModel
|
||||
{
|
||||
//[Required, EmailAddress]
|
||||
public string Email { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ThAmCo.Products.Data;
|
||||
using ThAmCo.Products.Models.DTOs;
|
||||
|
||||
namespace ThAmCo.Products.Models.ViewModels
|
||||
{
|
||||
public class DetailsWithReviewsModelcs
|
||||
{
|
||||
public Product Product { get; set; }
|
||||
public List<ReviewDto> Reviews { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ThAmCo.Products.Models.ViewModels
|
||||
{
|
||||
public class ProductsIndexModel
|
||||
{
|
||||
public IEnumerable<ProductsPriceStockModel> Products { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int? BrandId { get; set; }
|
||||
public int? CategoryId { get; set; }
|
||||
public double? PriceLow { get; set; }
|
||||
public double? PriceHigh { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using ThAmCo.Products.Data;
|
||||
|
||||
namespace ThAmCo.Products.Models.ViewModels
|
||||
{
|
||||
public class ProductsPriceStockModel
|
||||
{
|
||||
public Product Product { get; set; }
|
||||
public int? Stock { get; set; }
|
||||
public double? Price { get; set; }
|
||||
}
|
||||
}
|
||||
34
ThAmCo-Products/ThAmCo.Products/Program.cs
Normal file
34
ThAmCo-Products/ThAmCo.Products/Program.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using ThAmCo.Products.Data;
|
||||
|
||||
namespace ThAmCo.Products
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var host = CreateWebHostBuilder(args).Build();
|
||||
|
||||
using (var scope = host.Services.CreateScope())
|
||||
{
|
||||
var services = scope.ServiceProvider;
|
||||
var env = services.GetRequiredService<IHostingEnvironment>();
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
var context = services.GetRequiredService<ProductsDbContext>();
|
||||
context.Database.EnsureDeleted();
|
||||
context.Database.Migrate();
|
||||
}
|
||||
}
|
||||
|
||||
host.Run();
|
||||
}
|
||||
|
||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:63618",
|
||||
"sslPort": 44375
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ThAmCo.Products": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
102
ThAmCo-Products/ThAmCo.Products/Startup.cs
Normal file
102
ThAmCo-Products/ThAmCo.Products/Startup.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Polly;
|
||||
using ThAmCo.Products.Data;
|
||||
using ThAmCo.Products.Data.ProductsContext;
|
||||
|
||||
namespace ThAmCo.Products
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<CookiePolicyOptions>(options =>
|
||||
{
|
||||
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
|
||||
options.CheckConsentNeeded = context => true;
|
||||
options.MinimumSameSitePolicy = SameSiteMode.None;
|
||||
});
|
||||
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
|
||||
|
||||
services.AddDbContext<ProductsDbContext>(options => options.UseSqlServer(
|
||||
Configuration.GetConnectionString("ProductsSqlConnection"), optionsBuilder =>
|
||||
optionsBuilder.EnableRetryOnFailure(3, TimeSpan.FromSeconds(10), null)));
|
||||
|
||||
services.AddHttpClient("StandardRequest")
|
||||
.AddTransientHttpErrorPolicy(p =>
|
||||
p.OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))))
|
||||
.AddTransientHttpErrorPolicy(p =>
|
||||
p.CircuitBreakerAsync(5, TimeSpan.FromSeconds(30)));
|
||||
|
||||
services.AddHttpClient("ReviewRequest")
|
||||
.AddTransientHttpErrorPolicy(p =>
|
||||
p.OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
.WaitAndRetryAsync(1, retryAttempt => TimeSpan.FromSeconds(2)));
|
||||
|
||||
services.AddAuthorization(options =>
|
||||
{
|
||||
options.AddPolicy("StaffOnly", builder =>
|
||||
{
|
||||
builder.RequireClaim("role", "Staff");
|
||||
});
|
||||
});
|
||||
|
||||
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
options =>
|
||||
{
|
||||
options.LoginPath = new PathString("/account/login");
|
||||
options.AccessDeniedPath = new PathString("/account/AccessDenied");
|
||||
});
|
||||
|
||||
services.AddScoped<IProductsContext, ProductsContext>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
app.UseCookiePolicy();
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Products}/{action=Index}");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
23
ThAmCo-Products/ThAmCo.Products/ThAmCo.Products.csproj
Normal file
23
ThAmCo-Products/ThAmCo.Products/ThAmCo.Products.csproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Data\Migrations\20191105145110_InitialCreate.cs" />
|
||||
<Compile Remove="Data\Migrations\20191105145110_InitialCreate.Designer.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IdentityModel" Version="4.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "AccessDenied";
|
||||
}
|
||||
|
||||
<h1>AccessDenied</h1><br />
|
||||
|
||||
Access to page has been denied.
|
||||
|
||||
17
ThAmCo-Products/ThAmCo.Products/Views/Account/Login.cshtml
Normal file
17
ThAmCo-Products/ThAmCo.Products/Views/Account/Login.cshtml
Normal file
@@ -0,0 +1,17 @@
|
||||
@{
|
||||
ViewData["Title"] = "Login";
|
||||
}
|
||||
|
||||
<h1>Login</h1>
|
||||
|
||||
<form asp-action="Login">
|
||||
<div class="form-group">
|
||||
<label for="emailInput">Username</label>
|
||||
<input type="email" name="email" class="form-control" placeholder="Enter email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="passwordInput">Password</label>
|
||||
<input type="password" name="password" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</form>
|
||||
8
ThAmCo-Products/ThAmCo.Products/Views/Home/Index.cshtml
Normal file
8
ThAmCo-Products/ThAmCo.Products/Views/Home/Index.cshtml
Normal file
@@ -0,0 +1,8 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
||||
43
ThAmCo-Products/ThAmCo.Products/Views/Products/Create.cshtml
Normal file
43
ThAmCo-Products/ThAmCo.Products/Views/Products/Create.cshtml
Normal file
@@ -0,0 +1,43 @@
|
||||
@model ThAmCo.Products.Data.Product
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Create</h1>
|
||||
|
||||
<h4>Product</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Name" class="control-label"></label>
|
||||
<input asp-for="Name" class="form-control" />
|
||||
<span asp-validation-for="Name" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Description" class="control-label"></label>
|
||||
<input asp-for="Description" class="form-control" />
|
||||
<span asp-validation-for="Description" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="Active" /> @Html.DisplayNameFor(model => model.Active)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
39
ThAmCo-Products/ThAmCo.Products/Views/Products/Delete.cshtml
Normal file
39
ThAmCo-Products/ThAmCo.Products/Views/Products/Delete.cshtml
Normal file
@@ -0,0 +1,39 @@
|
||||
@model ThAmCo.Products.Data.Product
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Delete</h1>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>Product</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Name)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Name)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Description)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Description)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Active)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Active)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,56 @@
|
||||
@model ThAmCo.Products.Models.ViewModels.DetailsWithReviewsModelcs
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Product Details";
|
||||
}
|
||||
|
||||
<h1>Details</h1>
|
||||
|
||||
<div>
|
||||
<h4>Product</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Product.Name)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Product.Name)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Product.Description)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Product.Description)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div><h3>Reviews</h3></div><br />
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Reviews.FirstOrDefault().Content)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Reviews.FirstOrDefault().Rating)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Reviews)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Content)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Rating)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
44
ThAmCo-Products/ThAmCo.Products/Views/Products/Edit.cshtml
Normal file
44
ThAmCo-Products/ThAmCo.Products/Views/Products/Edit.cshtml
Normal file
@@ -0,0 +1,44 @@
|
||||
@model ThAmCo.Products.Data.Product
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Edit</h1>
|
||||
|
||||
<h4>Product</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Name" class="control-label"></label>
|
||||
<input asp-for="Name" class="form-control" />
|
||||
<span asp-validation-for="Name" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Description" class="control-label"></label>
|
||||
<input asp-for="Description" class="form-control" />
|
||||
<span asp-validation-for="Description" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" asp-for="Active" /> @Html.DisplayNameFor(model => model.Active)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
90
ThAmCo-Products/ThAmCo.Products/Views/Products/Index.cshtml
Normal file
90
ThAmCo-Products/ThAmCo.Products/Views/Products/Index.cshtml
Normal file
@@ -0,0 +1,90 @@
|
||||
@model ThAmCo.Products.Models.ViewModels.ProductsIndexModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<form asp-action="Index" method="get">
|
||||
<div class="form-group">
|
||||
<label>Name</label>
|
||||
<input type="text" class="form-control" asp-for="Name" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
<input type="text" class="form-control" asp-for="Description" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Brand</label>
|
||||
<select asp-for="BrandId" class="form-control" asp-items="ViewBag.BrandList"></select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Category</label>
|
||||
<select asp-for="CategoryId" class="form-control" asp-items="ViewBag.CategoryList"></select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Lowest Price</label>
|
||||
<input type="number" min="0" step="0.01" asp-for="PriceLow" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Highest Price</label>
|
||||
<input type="number" min="0" step="0.01" asp-for="PriceHigh" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Search" class="btn btn-default" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Product.Name)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Product.Description)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Price)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Stock)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Product.Brand)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Product.Category)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Products) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Product.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Product.Description)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Price)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Stock)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Product.Brand.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Product.Category.Name)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Details" asp-route-id="@item.Product.Id">View</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
25
ThAmCo-Products/ThAmCo.Products/Views/Shared/Error.cshtml
Normal file
25
ThAmCo-Products/ThAmCo.Products/Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,25 @@
|
||||
@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>
|
||||
@@ -0,0 +1,25 @@
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
|
||||
@{
|
||||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
|
||||
var showBanner = !consentFeature?.CanTrack ?? false;
|
||||
var cookieString = consentFeature?.CreateConsentCookie();
|
||||
}
|
||||
|
||||
@if (showBanner)
|
||||
{
|
||||
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
Use this space to summarize your privacy and cookie use policy. <a asp-area="" asp-controller="Home" asp-action="Privacy">Learn More</a>.
|
||||
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString">
|
||||
<span aria-hidden="true">Accept</span>
|
||||
</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var button = document.querySelector("#cookieConsent button[data-cookie-string]");
|
||||
button.addEventListener("click", function (event) {
|
||||
document.cookie = button.dataset.cookieString;
|
||||
}, false);
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
83
ThAmCo-Products/ThAmCo.Products/Views/Shared/_Layout.cshtml
Normal file
83
ThAmCo-Products/ThAmCo.Products/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - ThAmCo</title>
|
||||
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
||||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
|
||||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"/>
|
||||
</environment>
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</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">
|
||||
<a class="navbar-brand">ThAmCo</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-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 flex-sm-row-reverse">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Products" asp-action="Index">Products</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="https://localhost:44385">Admin</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Logout">Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="container">
|
||||
<partial name="_CookieConsentPartial" />
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2019 - ThAmCo.Products - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
|
||||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
|
||||
</script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o">
|
||||
</script>
|
||||
</environment>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A=">
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
|
||||
</script>
|
||||
</environment>
|
||||
@@ -0,0 +1,3 @@
|
||||
@using ThAmCo.Products
|
||||
@using ThAmCo.Products.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
3
ThAmCo-Products/ThAmCo.Products/Views/_ViewStart.cshtml
Normal file
3
ThAmCo-Products/ThAmCo.Products/Views/_ViewStart.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
11
ThAmCo-Products/ThAmCo.Products/appsettings.json
Normal file
11
ThAmCo-Products/ThAmCo.Products/appsettings.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"ProductsSqlConnection": "Server=(localdb)\\mssqllocaldb;Database=Products;Trusted_Connection=True;MultipleActiveResultSets=true"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
56
ThAmCo-Products/ThAmCo.Products/wwwroot/css/site.css
Normal file
56
ThAmCo-Products/ThAmCo.Products/wwwroot/css/site.css
Normal file
@@ -0,0 +1,56 @@
|
||||
/* Please see documentation at https://docs.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;
|
||||
}
|
||||
|
||||
/* Sticky footer styles
|
||||
-------------------------------------------------- */
|
||||
html {
|
||||
font-size: 14px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
/* Sticky footer styles
|
||||
-------------------------------------------------- */
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
/* Margin bottom by footer height */
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
/* Set the fixed height of the footer here */
|
||||
height: 60px;
|
||||
line-height: 60px; /* Vertically center the text there */
|
||||
}
|
||||
BIN
ThAmCo-Products/ThAmCo.Products/wwwroot/favicon.ico
Normal file
BIN
ThAmCo-Products/ThAmCo.Products/wwwroot/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
4
ThAmCo-Products/ThAmCo.Products/wwwroot/js/site.js
Normal file
4
ThAmCo-Products/ThAmCo.Products/wwwroot/js/site.js
Normal file
@@ -0,0 +1,4 @@
|
||||
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
// for details on configuring this project to bundle and minify static web assets.
|
||||
|
||||
// Write your JavaScript code.
|
||||
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2018 Twitter, Inc.
|
||||
Copyright (c) 2011-2018 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
3719
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css
vendored
Normal file
3719
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css
vendored
Normal file
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-grid.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
331
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css
vendored
Normal file
331
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.15;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: #212529;
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[tabindex="-1"]:focus {
|
||||
outline: 0 !important;
|
||||
}
|
||||
|
||||
hr {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title],
|
||||
abbr[data-original-title] {
|
||||
text-decoration: underline;
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
border-bottom: 0;
|
||||
-webkit-text-decoration-skip-ink: none;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: .5rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #0056b3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: middle;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
svg {
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
color: #6c757d;
|
||||
text-align: left;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
button,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
button:not(:disabled),
|
||||
[type="button"]:not(:disabled),
|
||||
[type="reset"]:not(:disabled),
|
||||
[type="submit"]:not(:disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
input[type="radio"],
|
||||
input[type="checkbox"] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input[type="date"],
|
||||
input[type="time"],
|
||||
input[type="datetime-local"],
|
||||
input[type="month"] {
|
||||
-webkit-appearance: listbox;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: .5rem;
|
||||
font-size: 1.5rem;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type="search"] {
|
||||
outline-offset: -2px;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
||||
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
8
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css
vendored
Normal file
8
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
10039
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.css
vendored
Normal file
10039
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css
vendored
Normal file
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7013
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js
vendored
Normal file
7013
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js
vendored
Normal file
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
4435
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.js
vendored
Normal file
4435
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.js.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js
vendored
Normal file
7
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
|
||||
Copyright (c) .NET Foundation. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
these files except in compliance with the License. You may obtain a copy of the
|
||||
License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations under the License.
|
||||
@@ -0,0 +1,432 @@
|
||||
// Unobtrusive validation support library for jQuery and jQuery Validate
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
// @version v3.2.11
|
||||
|
||||
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
|
||||
/*global document: false, jQuery: false */
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports
|
||||
module.exports = factory(require('jquery-validation'));
|
||||
} else {
|
||||
// Browser global
|
||||
jQuery.validator.unobtrusive = factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
var $jQval = $.validator,
|
||||
adapters,
|
||||
data_validation = "unobtrusiveValidation";
|
||||
|
||||
function setValidationValues(options, ruleName, value) {
|
||||
options.rules[ruleName] = value;
|
||||
if (options.message) {
|
||||
options.messages[ruleName] = options.message;
|
||||
}
|
||||
}
|
||||
|
||||
function splitAndTrim(value) {
|
||||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
|
||||
}
|
||||
|
||||
function escapeAttributeValue(value) {
|
||||
// As mentioned on http://api.jquery.com/category/selectors/
|
||||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
|
||||
}
|
||||
|
||||
function getModelPrefix(fieldName) {
|
||||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
|
||||
}
|
||||
|
||||
function appendModelPrefix(value, prefix) {
|
||||
if (value.indexOf("*.") === 0) {
|
||||
value = value.replace("*.", prefix);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function onError(error, inputElement) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
|
||||
replaceAttrValue = container.attr("data-valmsg-replace"),
|
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
|
||||
|
||||
container.removeClass("field-validation-valid").addClass("field-validation-error");
|
||||
error.data("unobtrusiveContainer", container);
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
error.removeClass("input-validation-error").appendTo(container);
|
||||
}
|
||||
else {
|
||||
error.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onErrors(event, validator) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-summary=true]"),
|
||||
list = container.find("ul");
|
||||
|
||||
if (list && list.length && validator.errorList.length) {
|
||||
list.empty();
|
||||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
|
||||
|
||||
$.each(validator.errorList, function () {
|
||||
$("<li />").html(this.message).appendTo(list);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onSuccess(error) { // 'this' is the form element
|
||||
var container = error.data("unobtrusiveContainer");
|
||||
|
||||
if (container) {
|
||||
var replaceAttrValue = container.attr("data-valmsg-replace"),
|
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
|
||||
|
||||
container.addClass("field-validation-valid").removeClass("field-validation-error");
|
||||
error.removeData("unobtrusiveContainer");
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onReset(event) { // 'this' is the form element
|
||||
var $form = $(this),
|
||||
key = '__jquery_unobtrusive_validation_form_reset';
|
||||
if ($form.data(key)) {
|
||||
return;
|
||||
}
|
||||
// Set a flag that indicates we're currently resetting the form.
|
||||
$form.data(key, true);
|
||||
try {
|
||||
$form.data("validator").resetForm();
|
||||
} finally {
|
||||
$form.removeData(key);
|
||||
}
|
||||
|
||||
$form.find(".validation-summary-errors")
|
||||
.addClass("validation-summary-valid")
|
||||
.removeClass("validation-summary-errors");
|
||||
$form.find(".field-validation-error")
|
||||
.addClass("field-validation-valid")
|
||||
.removeClass("field-validation-error")
|
||||
.removeData("unobtrusiveContainer")
|
||||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
||||
.removeData("unobtrusiveContainer");
|
||||
}
|
||||
|
||||
function validationInfo(form) {
|
||||
var $form = $(form),
|
||||
result = $form.data(data_validation),
|
||||
onResetProxy = $.proxy(onReset, form),
|
||||
defaultOptions = $jQval.unobtrusive.options || {},
|
||||
execInContext = function (name, args) {
|
||||
var func = defaultOptions[name];
|
||||
func && $.isFunction(func) && func.apply(form, args);
|
||||
};
|
||||
|
||||
if (!result) {
|
||||
result = {
|
||||
options: { // options structure passed to jQuery Validate's validate() method
|
||||
errorClass: defaultOptions.errorClass || "input-validation-error",
|
||||
errorElement: defaultOptions.errorElement || "span",
|
||||
errorPlacement: function () {
|
||||
onError.apply(form, arguments);
|
||||
execInContext("errorPlacement", arguments);
|
||||
},
|
||||
invalidHandler: function () {
|
||||
onErrors.apply(form, arguments);
|
||||
execInContext("invalidHandler", arguments);
|
||||
},
|
||||
messages: {},
|
||||
rules: {},
|
||||
success: function () {
|
||||
onSuccess.apply(form, arguments);
|
||||
execInContext("success", arguments);
|
||||
}
|
||||
},
|
||||
attachValidation: function () {
|
||||
$form
|
||||
.off("reset." + data_validation, onResetProxy)
|
||||
.on("reset." + data_validation, onResetProxy)
|
||||
.validate(this.options);
|
||||
},
|
||||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
||||
$form.validate();
|
||||
return $form.valid();
|
||||
}
|
||||
};
|
||||
$form.data(data_validation, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
$jQval.unobtrusive = {
|
||||
adapters: [],
|
||||
|
||||
parseElement: function (element, skipAttach) {
|
||||
/// <summary>
|
||||
/// Parses a single HTML element for unobtrusive validation attributes.
|
||||
/// </summary>
|
||||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
||||
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
|
||||
/// validation to the form. If parsing just this single element, you should specify true.
|
||||
/// If parsing several elements, you should specify false, and manually attach the validation
|
||||
/// to the form when you are finished. The default is false.</param>
|
||||
var $element = $(element),
|
||||
form = $element.parents("form")[0],
|
||||
valInfo, rules, messages;
|
||||
|
||||
if (!form) { // Cannot do client-side validation without a form
|
||||
return;
|
||||
}
|
||||
|
||||
valInfo = validationInfo(form);
|
||||
valInfo.options.rules[element.name] = rules = {};
|
||||
valInfo.options.messages[element.name] = messages = {};
|
||||
|
||||
$.each(this.adapters, function () {
|
||||
var prefix = "data-val-" + this.name,
|
||||
message = $element.attr(prefix),
|
||||
paramValues = {};
|
||||
|
||||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
||||
prefix += "-";
|
||||
|
||||
$.each(this.params, function () {
|
||||
paramValues[this] = $element.attr(prefix + this);
|
||||
});
|
||||
|
||||
this.adapt({
|
||||
element: element,
|
||||
form: form,
|
||||
message: message,
|
||||
params: paramValues,
|
||||
rules: rules,
|
||||
messages: messages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.extend(rules, { "__dummy__": true });
|
||||
|
||||
if (!skipAttach) {
|
||||
valInfo.attachValidation();
|
||||
}
|
||||
},
|
||||
|
||||
parse: function (selector) {
|
||||
/// <summary>
|
||||
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
|
||||
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
|
||||
/// attribute values.
|
||||
/// </summary>
|
||||
/// <param name="selector" type="String">Any valid jQuery selector.</param>
|
||||
|
||||
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
|
||||
// element with data-val=true
|
||||
var $selector = $(selector),
|
||||
$forms = $selector.parents()
|
||||
.addBack()
|
||||
.filter("form")
|
||||
.add($selector.find("form"))
|
||||
.has("[data-val=true]");
|
||||
|
||||
$selector.find("[data-val=true]").each(function () {
|
||||
$jQval.unobtrusive.parseElement(this, true);
|
||||
});
|
||||
|
||||
$forms.each(function () {
|
||||
var info = validationInfo(this);
|
||||
if (info) {
|
||||
info.attachValidation();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
adapters = $jQval.unobtrusive.adapters;
|
||||
|
||||
adapters.add = function (adapterName, params, fn) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
|
||||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
||||
/// mmmm is the parameter name).</param>
|
||||
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
|
||||
/// attributes into jQuery Validate rules and/or messages.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
if (!fn) { // Called with no params, just a function
|
||||
fn = params;
|
||||
params = [];
|
||||
}
|
||||
this.push({ name: adapterName, params: params, adapt: fn });
|
||||
return this;
|
||||
};
|
||||
|
||||
adapters.addBool = function (adapterName, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has no parameter values.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, true);
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
|
||||
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a minimum value.</param>
|
||||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a maximum value.</param>
|
||||
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
|
||||
/// have both a minimum and maximum value.</param>
|
||||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the minimum value. The default is "min".</param>
|
||||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the maximum value. The default is "max".</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
|
||||
var min = options.params.min,
|
||||
max = options.params.max;
|
||||
|
||||
if (min && max) {
|
||||
setValidationValues(options, minMaxRuleName, [min, max]);
|
||||
}
|
||||
else if (min) {
|
||||
setValidationValues(options, minRuleName, min);
|
||||
}
|
||||
else if (max) {
|
||||
setValidationValues(options, maxRuleName, max);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has a single value.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
|
||||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
||||
/// The default is "val".</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [attribute || "val"], function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
|
||||
});
|
||||
};
|
||||
|
||||
$jQval.addMethod("__dummy__", function (value, element, params) {
|
||||
return true;
|
||||
});
|
||||
|
||||
$jQval.addMethod("regex", function (value, element, params) {
|
||||
var match;
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
match = new RegExp(params).exec(value);
|
||||
return (match && (match.index === 0) && (match[0].length === value.length));
|
||||
});
|
||||
|
||||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
|
||||
var match;
|
||||
if (nonalphamin) {
|
||||
match = value.match(/\W/g);
|
||||
match = match && match.length >= nonalphamin;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
if ($jQval.methods.extension) {
|
||||
adapters.addSingleVal("accept", "mimtype");
|
||||
adapters.addSingleVal("extension", "extension");
|
||||
} else {
|
||||
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
|
||||
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
|
||||
// validating the extension, and ignore mime-type validations as they are not supported.
|
||||
adapters.addSingleVal("extension", "extension", "accept");
|
||||
}
|
||||
|
||||
adapters.addSingleVal("regex", "pattern");
|
||||
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
|
||||
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
|
||||
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
|
||||
adapters.add("equalto", ["other"], function (options) {
|
||||
var prefix = getModelPrefix(options.element.name),
|
||||
other = options.params.other,
|
||||
fullOtherName = appendModelPrefix(other, prefix),
|
||||
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
|
||||
|
||||
setValidationValues(options, "equalTo", element);
|
||||
});
|
||||
adapters.add("required", function (options) {
|
||||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
||||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
|
||||
setValidationValues(options, "required", true);
|
||||
}
|
||||
});
|
||||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
|
||||
var value = {
|
||||
url: options.params.url,
|
||||
type: options.params.type || "GET",
|
||||
data: {}
|
||||
},
|
||||
prefix = getModelPrefix(options.element.name);
|
||||
|
||||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
|
||||
var paramName = appendModelPrefix(fieldName, prefix);
|
||||
value.data[paramName] = function () {
|
||||
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
|
||||
// For checkboxes and radio buttons, only pick up values from checked fields.
|
||||
if (field.is(":checkbox")) {
|
||||
return field.filter(":checked").val() || field.filter(":hidden").val() || '';
|
||||
}
|
||||
else if (field.is(":radio")) {
|
||||
return field.filter(":checked").val() || '';
|
||||
}
|
||||
return field.val();
|
||||
};
|
||||
});
|
||||
|
||||
setValidationValues(options, "remote", value);
|
||||
});
|
||||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
|
||||
if (options.params.min) {
|
||||
setValidationValues(options, "minlength", options.params.min);
|
||||
}
|
||||
if (options.params.nonalphamin) {
|
||||
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
|
||||
}
|
||||
if (options.params.regex) {
|
||||
setValidationValues(options, "regex", options.params.regex);
|
||||
}
|
||||
});
|
||||
adapters.add("fileextensions", ["extensions"], function (options) {
|
||||
setValidationValues(options, "extension", options.params.extensions);
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$jQval.unobtrusive.parse(document);
|
||||
});
|
||||
|
||||
return $jQval.unobtrusive;
|
||||
}));
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright Jörn Zaefferer
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
1158
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/additional-methods.js
vendored
Normal file
1158
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/additional-methods.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/additional-methods.min.js
vendored
Normal file
4
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/additional-methods.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1601
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/jquery.validate.js
vendored
Normal file
1601
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/jquery.validate.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
vendored
Normal file
4
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
|
||||
Copyright JS Foundation and other contributors, https://js.foundation/
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/jquery/jquery
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
All files located in the node_modules and external directories are
|
||||
externally maintained libraries used by this software which have their
|
||||
own licenses; we recommend you read them, as their terms may differ from
|
||||
the terms above.
|
||||
10364
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery/dist/jquery.js
vendored
Normal file
10364
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery/dist/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery/dist/jquery.min.js
vendored
Normal file
2
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery/dist/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery/dist/jquery.min.map
vendored
Normal file
1
ThAmCo-Products/ThAmCo.Products/wwwroot/lib/jquery/dist/jquery.min.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user