2023-04-13 00:10:37 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2023-04-13 00:49:02 +04:00
|
|
|
|
using TransportCompanyContracts.BindingModels;
|
|
|
|
|
using TransportCompanyContracts.ViewModels;
|
2023-04-13 00:10:37 +04:00
|
|
|
|
|
|
|
|
|
namespace TransportCompanyDatabaseImplements.Models;
|
|
|
|
|
|
|
|
|
|
public partial class Cargo
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
public string TypeCargo { get; set; } = null!;
|
|
|
|
|
|
|
|
|
|
public virtual ICollection<Trucking> Truckings { get; set; } = new List<Trucking>();
|
2023-04-13 00:49:02 +04:00
|
|
|
|
|
|
|
|
|
public static Cargo Create(CargoBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
return new Cargo()
|
|
|
|
|
{
|
|
|
|
|
Id = model.Id,
|
|
|
|
|
TypeCargo = model.TypeCargo
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Update(CargoBindingModel model)
|
|
|
|
|
{
|
|
|
|
|
TypeCargo = model.TypeCargo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CargoViewModel GetViewModel => new()
|
|
|
|
|
{
|
|
|
|
|
Id = Id,
|
|
|
|
|
TypeCargo = TypeCargo
|
|
|
|
|
};
|
2023-04-13 00:10:37 +04:00
|
|
|
|
}
|