Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace CarDealer.DTOs.Import
- {
- using CarDealer.Models;
- using Newtonsoft.Json;
- [JsonObject]
- public class ImportsPartsDto
- {
- [JsonProperty("name")]
- public string Name { get; set; }
- [JsonProperty("price")]
- public decimal Price { get; set; }
- [JsonProperty("quantity")]
- public int Quantity { get; set; }
- [JsonProperty("supplierId")]
- public int SupplierId { get; set; }
- public void FromPart(Part part)
- {
- this.Name = part.Name;
- this.Price = part.Price;
- this.Quantity = part.Quantity;
- this.SupplierId = part.SupplierId;
- }
- public Part ToPart()
- {
- Part part = new Part();
- part.Name = this.Name;
- part.Price = this.Price;
- part.Quantity = this.Quantity;
- part.SupplierId = this.SupplierId;
- return part;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement