init context with entityType and entitySet when invoke function.