Added extension method for Write on context