f97f891d67
Full ASP.NET Core 10 Razor Pages app for آساد ابزار tool repair shop in Karaj, Iran (official DeWalt representative). Features: - Homepage, Services, DeWalt page, Shop (pagination + images) - 10 brand SEO pages (/brands/*) with rich Persian content + FAQ schema - Blog engine with admin management (/blog, /Admin/Blog) - Cart, Checkout, Contact (OpenStreetMap embed) - Admin panel: Products CRUD, Orders, Blog, Change Password - Jalali date formatting, product images, SiteData centralised contact - Docker + docker-compose with healthcheck - Gitea CI/CD via .gitea/workflows/ci-cd.yml (NuGet through Nexus mirror) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
921 B
C#
23 lines
921 B
C#
using AsadiTools.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace AsadiTools.Data;
|
|
|
|
public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
|
|
{
|
|
public DbSet<Product> Products => Set<Product>();
|
|
public DbSet<Order> Orders => Set<Order>();
|
|
public DbSet<OrderItem> OrderItems => Set<OrderItem>();
|
|
public DbSet<AdminUser> AdminUsers => Set<AdminUser>();
|
|
public DbSet<BlogPost> BlogPosts => Set<BlogPost>();
|
|
|
|
protected override void OnModelCreating(ModelBuilder mb)
|
|
{
|
|
mb.Entity<Product>().Property(p => p.Price).HasColumnType("TEXT");
|
|
mb.Entity<Product>().Property(p => p.DiscountPrice).HasColumnType("TEXT");
|
|
mb.Entity<Order>().Property(o => o.Subtotal).HasColumnType("TEXT");
|
|
mb.Entity<Order>().Property(o => o.Total).HasColumnType("TEXT");
|
|
mb.Entity<OrderItem>().Property(i => i.Price).HasColumnType("TEXT");
|
|
}
|
|
}
|