Andrew F. answered 07/01/19
Knowledgeable Tutor Specializing in Biology, Biochemistry, and Math
Remember that a true ionic bond is defined by the difference in two elements' electronegativity (EN) values >1.7. Carbon has EN = 2.55 and Mg has EN = 1.31. Therefore since the difference is 1.57 (<1.7), the bond is not entirely ionic. Therefore there is some degree of covalent character to the bond between these 2 elements.
Hope this helps!