Im using Breeze in my ASP.NET WebAPI Project, I have added the breezecontroller
[BreezeController]
public class BreezeController : ApiController
{
readonly EFContextProvider<MyEntities> _context
= new EFContextProvider<MyEntities>();
[HttpGet]
public string Metadata()
{
return _context.Metadata();
}
unfortunately when I call createEntity I get the error Cannot attach an object to an EntityManager without first setting its key or setting its entityType 'AutoGeneratedKeyType' property to something other than 'None'
Isn't breeze auto intialized the entity when the metadata api was called?
TIA
Please post your client side breeze code. Without it I can't tell for sure, but I would guess that you have not fetched the metadata for that entity before your "createEntity" call. You must have the metadataStore before you can create an entity. For example: