我在我的 ASP.NET WebAPI 项目中使用微风,我添加了微风控制器
[BreezeController]
public class BreezeController : ApiController
{
readonly EFContextProvider<MyEntities> _context
= new EFContextProvider<MyEntities>();
[HttpGet]
public string Metadata()
{
return _context.Metadata();
}
不幸的是,当我调用 createEntity 时,我收到错误 Cannot attach an object to an EntityManager without first setting its key or setting its entityType 'AutoGeneratedKeyType' property to something other than 'None'
调用元数据api时,微风不是自动初始化实体吗?
TIA