How to write it pretty?

Hi i am new in c# and i want to ask how to write this code more prety

public void Update(Product pr)
    {
        Product prod = GeProductById(pr.ProductID);
        prod.Name       = pr.Name;
        prod.Count      = pr.Count;
        prod.InputPrice = pr.InputPrice;
        prod.InputDate  = pr.InputDate;
        prod.OutPrice   = pr.OutPrice;
        prod.InputPriceByCurrency   = pr.InputPriceByCurrency;
        prod.InputPriceCurrency     = pr.InputPriceCurrency;
        prod.ComeOwner  = pr.ComeOwner;
        prod.GroupID    = pr.GroupID;
        prod.Discount   = pr.Discount;

        _context.SubmitChanges();
    }

All it do just copy all properties except id. Can i write it shortly? Thanx and sorry for my bad english

5
задан Carlos Muñoz 4 December 2010 в 15:41
поделиться