Should ToEntity<T> Be Used Instead Of A Cast?

Viewed 3028

The Xrm Sdk defines a ToEntity<T> method. I've always used it to get my early bound entities from CRM. Today I was reviewing some code and saw that the entities were just getting cast:

var contact = service.Retrieve("contact", id, new ColumnSet()) as Contact;

I wasn't even aware of that being possible. Is the ToEntity call even needed anymore?

2 Answers
Related