diff --git a/lib/ruby_odata/class_builder.rb b/lib/ruby_odata/class_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby_odata/class_builder.rb
+++ b/lib/ruby_odata/class_builder.rb
@@ -110,6 +110,14 @@ module OData
           end
         end
 
+        props = self.class.properties
+
+        # Convert a Int64 to a string for serialization (to match Edm.Int64)
+        bigints = vars.find_all { |o| props[o[0]] && props[o[0]].type == "Edm.Int64" } || []
+        bigints.each do |i|
+          vars[i[0]] = i[1].to_s
+        end
+
         # Convert a BigDecimal to a string for serialization (to match Edm.Decimal)
         decimals = vars.find_all { |o| o[1].class == BigDecimal } || []
         decimals.each do |d|
Edm.Int<I> should be string formatted according to odata json spec