Hi,
I am having problem with the generated code in mono. It seems there is some issue with bigint data type in SQL server table. I kept getting the error:
Unhandled Exception: System.InvalidCastException: Cannot cast from source type to destination type.
at DAL.EntityClasses.CommunityEntity.get_Id () [0x00000]
at test.GetCommunityV2.GetCommunity () [0x00000]
at test.Program.Main (System.String[] argv) [0x00000]
But if I do the query manually by using something like:
sc = new Community(reader.GetInt64(0));
mono can handle the bigint reading fine.
I check the generated code in the CommunityEntity and did not find anything suspicious.
public virtual System.Int64 Id
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)CommunityFieldIndex.Id);
if(valueToReturn == null)
{
valueToReturn =TypeDefaultValue.GetDefaultValue(typeof(System.Int64));
}
return (System.Int64)valueToReturn;
}
set { SetNewFieldValue((int)CommunityFieldIndex.Id, value); }
}
Could you please help this? A lot of tables in our SQL database are using bigint and we really would like to make it work under mono.
I am using LLBL Gen Pro 2.0.0.0 final, mono 1.2.3.1. I tried mono in Windows XP and Mac OS tiger.
Thanks a lot for your help!
luanzhu