def _convert_entity_to_json(source):
properties = {}<EOL>for name, value in source.items():<EOL><INDENT>mtype = '<STR_LIT>'<EOL>if isinstance(value, EntityProperty):<EOL><INDENT>conv = _EDM_TO_ENTITY_CONVERSIONS.get(value.type)<EOL>if conv is None:<EOL><INDENT>raise TypeError(<EOL>_ERROR_TYPE_NOT_SUPPORTED.format(value.type))<EOL><DEDENT>mtype, value = conv(value.value)<EOL><DEDENT>else:<EOL><INDENT>conv = _PYTHON_TO_ENTITY_CONVERSIONS.get(type(value))<EOL>if conv is None and sys.version_info >= (<NUM_LIT:3>,) and value is None:<EOL><INDENT>conv = _to_entity_none<EOL><DEDENT>if conv is None:<EOL><INDENT>raise TypeError(<EOL>_ERROR_CANNOT_SERIALIZE_VALUE_TO_ENTITY.format(<EOL>type(value).__name__))<EOL><DEDENT>mtype, value = conv(value)<EOL><DEDENT>properties[name] = value<EOL>if mtype:<EOL><INDENT>properties[name + '<STR_LIT>'] = mtype<EOL><DEDENT><DEDENT>return dumps(properties)<EOL>
Converts an entity object to json to send.
    The entity format is:
    {
       "Address":"Mountain View",
       "Age":23,
       "AmountDue":200.23,
       "CustomerCode@odata.type":"Edm.Guid",
       "CustomerCode":"c9da6455-213d-42c9-9a79-3e9149a57833",
       "CustomerSince@odata.type":"Edm.DateTime",
       "CustomerSince":"2008-07-10T00:00:00",
       "IsActive":true,
       "NumberOfOrders@odata.type":"Edm.Int64",
       "NumberOfOrders":"255",
       "PartitionKey":"mypartitionkey",
       "RowKey":"myrowkey"
    }