mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
35 lines
814 B
C#
35 lines
814 B
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.ComponentModel.DataAnnotations;
|
|||
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|||
|
|
using Microsoft.EntityFrameworkCore;
|
|||
|
|
|
|||
|
|
namespace Packt.Shared
|
|||
|
|
{
|
|||
|
|
[Index("CategoryName", Name = "CategoryName")]
|
|||
|
|
public partial class Category
|
|||
|
|
{
|
|||
|
|
public Category()
|
|||
|
|
{
|
|||
|
|
Products = new HashSet<Product>();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Key]
|
|||
|
|
public int CategoryId { get; set; }
|
|||
|
|
|
|||
|
|
[Required]
|
|||
|
|
[Column(TypeName = "nvarchar (15)")]
|
|||
|
|
[StringLength(15)]
|
|||
|
|
public string CategoryName { get; set; } = null!;
|
|||
|
|
|
|||
|
|
[Column(TypeName = "ntext")]
|
|||
|
|
public string? Description { get; set; }
|
|||
|
|
|
|||
|
|
[Column(TypeName = "image")]
|
|||
|
|
public byte[]? Picture { get; set; }
|
|||
|
|
|
|||
|
|
[InverseProperty("Category")]
|
|||
|
|
public virtual ICollection<Product> Products { get; set; }
|
|||
|
|
}
|
|||
|
|
}
|