The only thing I could find about enum support in breeze.js is this feature suggestion on uservoice, which was recently marked as closed in 0.82. I'm using currently latest, 0.84.3.
UPDATE: I'm using code first in EF 5.0.0 with .net 4.5. When starting application and breeze makes request for metadata, EF creates empty database and my enum property is in database as int, so that part is ok.
However, when I added an enum property to my model, I got exception when breeze tried to parse metadata:
Uncaught Error: Unable to locate an 'Type' by the name: ItemType:#TestApp.Models breeze.debug.js:5051
getTypeFromMap breeze.debug.js:5051
ctor.getEntityType breeze.debug.js:5028
ctor._updateProperty breeze.debug.js:6056
ctor._fixup breeze.debug.js:6133
ctor._fixup breeze.debug.js:6132
ctor.addEntityType breeze.debug.js:4702
convertFromODataEntityType
This is my model (simplified):
public enum ItemType
{
Ordered,
Approved,
Misc
}
public class Item
{
public long Id { get; set; }
public ItemType Type { get; set; }
}
Where am I making mistake? Is there working sample with enum?