travis thelen
travis thelen

Reputation: 67

Does breeze support Entity Framework 6

I am getting odd behavior in the Web API. If I decorate with [BreezeController] then my breakpoint in the Metadata() is not hit. If I remove [BreezeController] it hits the breakpoint but obviously fails as the method does not exist. I am using EF6 alpha 2 ... an issue?

Any ideas? Code sample for API controller is below.

Thanks, Travis

namespace Mosaic.Bio.WebApi.Controllers
{
    public class MosaicBreezeContextProvider : EFContextProvider<Entities>
    {
        public MosaicBreezeContextProvider() : base() { }

        protected override Entities CreateContext()
        {
            return new Entities(Entities.GetOracleEntityConnection(),true);
        }
    }

    [BreezeController]
    public class BreezeController : ApiController
    {
        readonly MosaicBreezeContextProvider _contextProvider = new MosaicBreezeContextProvider();     

        [HttpGet]    
        public string Metadata() 
        {        
            return _contextProvider.Metadata();   
        }     

        [HttpGet]    
        public IQueryable<COR_PERSON> CorPersons() 
        {        
            return _contextProvider.Context.COR_PERSON;    
        }     

        [HttpPost]    
        public SaveResult SaveChanges(JObject saveBundle) 
        {        
            return _contextProvider.SaveChanges(saveBundle);    
        }     

    }
}

Upvotes: 1

Views: 644

Answers (2)

Jay Traband
Jay Traband

Reputation: 17052

Updated 10/28/2013:

As of now, Breeze 1.4.5 has support for Microsoft's ASP.NET WebApi 2 and Entity Framework 6. Please see http://www.breezejs.com/documentation/download.

Old post...

We haven't yet tested against the EF 6 Alpha... and honestly are unlikely to do so until at least they release an EF 6 Release Candidate.

But that said, this doesn't look like an EF issue. Does this same code work with the current EF bits?

Upvotes: 1

travis thelen
travis thelen

Reputation: 67

Looks like the issue was due to EF6. I got the source for Breeze.WebApi, updated the code to use new EF6 namespaces, and rebuilt.

All is working fine now.

Regards, Travis

Upvotes: 1

Related Questions