public static Productpr ToProductpr(this ProductprEntity orderEntity, Productpr dbmodel = null) { Productpr model = dbmodel; if (model == null) { model = new Productpr(); } model.Name = orderEntity.Name; model.Parentid = orderEntity.Parentid; model.CountryOfOrigin = orderEntity.CountryOfOrigin; model.Price = orderEntity.Price; model.ShelfLife = orderEntity.ShelfLife; model.AvailableAmount = orderEntity.AvailableAmount; return(model); }
public static ProductprEntity ToProductprEntity(this Productpr model) { if (model == null) { return(null); } ProductprEntity orderEntity = new ProductprEntity(); orderEntity.Id = model.Id; orderEntity.Name = model.Name; orderEntity.Parentid = model.Parentid; orderEntity.CountryOfOrigin = model.CountryOfOrigin; orderEntity.Price = model.Price; orderEntity.ShelfLife = model.ShelfLife; orderEntity.AvailableAmount = model.AvailableAmount; return(orderEntity); }