add sample code for getting entity