When using a simple enum with Entity Framework 6, Code First,
as described in that article:
http://msdn.microsoft.com/en-us/data/hh859576.aspx
i get the error:
An exception of type 'System.Data.Entity.Core.EntityCommandCompilationException' occurred in mscorlib.dll but was not handled in user code
Additional information: An error occurred while preparing the command definition.
See the inner exception for details.
{"The ResultType of the specified expression is not compatible with the required type.
The expression ResultType is 'Hdi.Wizball.KfaService.Data.FunktionType' but the required type is 'Edm.Int64'.
\r\nParameter name: keyValues[0]"}
the code: (all available ids from the database exist here)
public enum FunktionType : long
{
Element1 = 1,
Element2 = 2,
Element3 = 3,
Element4 = 8,
Element5 = 10,
Element6 = 12
}
public partial class Geschaeftsfall
{
public long GeschaeftsfallId { get; set; }
public DateTime? DurchfuehrungsDatum { get; set; }
public FunktionType? FunktionId { get; set; }
....
}
if a replace the enum with a Long?, everything works,
but i want to use the enum,..
thanks for any help in advance,
Thomas.