public Investment Add(Investment investment) { if (investment.IsTransient()) { return(_context.Investments .Add(investment) .Entity); } else { return(investment); } }