ссылки у кладовщика и работника
This commit is contained in:
parent
2643f53e0b
commit
4391a40a78
@ -2,6 +2,7 @@
|
|||||||
using ComputerHardwareStoreContracts.ViewModels;
|
using ComputerHardwareStoreContracts.ViewModels;
|
||||||
using ComputerHardwareStoreDataModels.Models;
|
using ComputerHardwareStoreDataModels.Models;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace ComputerHardwareStoreDatabaseImplement.Models
|
namespace ComputerHardwareStoreDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
@ -16,6 +17,11 @@ namespace ComputerHardwareStoreDatabaseImplement.Models
|
|||||||
[Required]
|
[Required]
|
||||||
|
|
||||||
public string Password { get; private set; } = string.Empty;
|
public string Password { get; private set; } = string.Empty;
|
||||||
|
[ForeignKey("StoreKeeperId")]
|
||||||
|
public virtual List<Product> Products { get; set; } = new();
|
||||||
|
[ForeignKey("StoreKeeperId")]
|
||||||
|
public virtual List<Component> Components { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
public static StoreKeeper? Create(ComputerHardwareStoreDBContext context, StoreKeeperBindingModel model)
|
public static StoreKeeper? Create(ComputerHardwareStoreDBContext context, StoreKeeperBindingModel model)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using ComputerHardwareStoreContracts.ViewModels;
|
using ComputerHardwareStoreContracts.ViewModels;
|
||||||
using ComputerHardwareStoreDataModels.Models;
|
using ComputerHardwareStoreDataModels.Models;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
namespace ComputerHardwareStoreDatabaseImplement.Models
|
namespace ComputerHardwareStoreDatabaseImplement.Models
|
||||||
{
|
{
|
||||||
@ -16,6 +17,10 @@ namespace ComputerHardwareStoreDatabaseImplement.Models
|
|||||||
[Required]
|
[Required]
|
||||||
|
|
||||||
public string Password { get; private set; } = string.Empty;
|
public string Password { get; private set; } = string.Empty;
|
||||||
|
[ForeignKey("VendorId")]
|
||||||
|
public virtual List<Purchase> Purchases { get; set; } = new();
|
||||||
|
[ForeignKey("VendorId")]
|
||||||
|
public virtual List<Build> Builds { get; set; } = new();
|
||||||
|
|
||||||
public static Vendor? Create(ComputerHardwareStoreDBContext context, VendorBindingModel model)
|
public static Vendor? Create(ComputerHardwareStoreDBContext context, VendorBindingModel model)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user