main
| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using System.ComponentModel.DataAnnotations;
|
|---|
| 3 | using System.ComponentModel.DataAnnotations.Schema;
|
|---|
| 4 |
|
|---|
| 5 | namespace StockMaster.Models
|
|---|
| 6 | {
|
|---|
| 7 | [Table("warehouse", Schema = "stock_management")]
|
|---|
| 8 | public class Warehouse
|
|---|
| 9 | {
|
|---|
| 10 | [Key]
|
|---|
| 11 | [Column("warehouse_id")]
|
|---|
| 12 | public int WarehouseId { get; set; }
|
|---|
| 13 |
|
|---|
| 14 | [Required(ErrorMessage = "Warehouse name is required")]
|
|---|
| 15 | [MaxLength(100)]
|
|---|
| 16 | [Column("name")]
|
|---|
| 17 | public string Name { get; set; }
|
|---|
| 18 |
|
|---|
| 19 | [Required(ErrorMessage = "Location is required")]
|
|---|
| 20 | [MaxLength(255)]
|
|---|
| 21 | [Column("location")]
|
|---|
| 22 | public string Location { get; set; }
|
|---|
| 23 |
|
|---|
| 24 | [Required(ErrorMessage = "Capacity is required")]
|
|---|
| 25 | [Range(1, int.MaxValue, ErrorMessage = "Capacity must be greater than 0")]
|
|---|
| 26 | [Column("capacity")]
|
|---|
| 27 | public int Capacity { get; set; }
|
|---|
| 28 |
|
|---|
| 29 | [Column("created_at")]
|
|---|
| 30 | public DateTime CreatedAt { get; set; } = DateTime.Now;
|
|---|
| 31 | }
|
|---|
| 32 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.