neisbut / Npgsql.Bulk

Helper for performing COPY (bulk insert and update) operation easily, using Entity Framework + Npgsql.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enum with underlying type long

alec-anikin opened this issue · comments

NpgsqlBulkCodeBuilder line 158

else if (mi.ReturnType.GetTypeInfo().IsEnum)
{
     ilOut.Emit(OpCodes.Ldc_I4_S, (int)info.NpgsqlType);
     ilOut.Emit(OpCodes.Call, writeMethodFull.MakeGenericMethod(typeof(Int32)));
}

There should be check for enum:long.
Thanks for useful library!

Not only long but all possible integer types should be supported. Just pass Enum.GetUnderlyingType() instead of hardcoded Int32.

Hi @alec-anikin, @msvprogs, thanks for usefull suggestion. I've implemented this in 0.6.9 release. Please check.