You have several solutions:
- You can change vmTest class definition and replace field1 type from long to long?
- You can change your table in database and transforms xxx from NULL to NOT NULL then xxx will become a long
You can use a condition in your query like
new vmTest { field1 = m.xxx.HasValue ? m.xxx.Value : 0 }
More information on Nullables here