public static OrderProduct ToOrderProduct(OrderProductViewModel orderProduct) { OrderProduct vm = new OrderProduct { Id = orderProduct.Id, GenotypeId = orderProduct.GenotypeId, MaterialId = orderProduct.MaterialId, OrderId = orderProduct.OrderId, Quantity = orderProduct.Quantity, Note = orderProduct.Note, VirusTested = orderProduct.VirusTested, DateSent = orderProduct.DateSent }; return(vm); }
public static OrderProductViewModel Create(OrderProduct op) { OrderProductViewModel vm = new OrderProductViewModel { Id = op.Id, GenotypeId = op.GenotypeId, MaterialId = op.MaterialId, OrderId = op.OrderId, Quantity = op.Quantity, Note = op.Note, VirusTested = op.VirusTested, GenotypeName = op.Genotype.Name, GenotypeVM = op.Genotype.ToGenotypeVM(), DateSent = op.DateSent }; return(vm); }