Hacker News new | ask | show | jobs
by mendicant 5524 days ago
That's part of it. But the author should articulate it.

There is also certain (specific) situations where the original code (e.NewItem as Customer).Save() would fail but ((Customer)e.NewItem).Save() wouldn't. That specific case is where the type of e.NewItem has an implicit cast to Customer (as would return null, but a (Customer) cast would work).

But if you're doing implicit casting you might be facing other issues.