如何我会用微风实体框架6 .NE​​T 4.0 [英] How will I use breeze with Entity Framework 6 with .net 4.0

查看:130
本文介绍了如何我会用微风实体框架6 .NE​​T 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装我的4.0 MVC项目,实体框架6使用的NuGet(使ODE先迁移)。然后我试图安装包清风Breeze.Server.ContextProvider.EF6。但我有缺失集引用错误的微风。

I installed my 4.0 MVC project, Entity Framework 6 using nuget(to enable ode first migrations). Then I tried installing breeze package Breeze.Server.ContextProvider.EF6. But I'm having missing assembly reference errors for breeze.

推荐答案

我能得到微风.NET 4.0的工作与实体框架6的唯一方法就是使用的从GitHub微风源$ C ​​$ C 的作为一个起点。

The only way I was able to get Breeze working on .NET 4.0 with Entity Framework 6 was to create my own EF6ContextProvider using the Breeze source code from GitHub as a starting point.

我创建了一个项目 Breeze.WebApi.EF6 并添加一个类 EF6ContextProvider.cs 这是pretty在官方 Breeze.WebApi.EF 项目的 EFContextProvider.cs 多大的直接拷贝。唯一真正的变化是使用EF6 语句(在code是太长张贴)重命名空间和类,并调整。该项目的NuGet引用 Breeze.Server.WebApi.Core 的EntityFramework - 微风包了一堆拉依赖关系,我不得不引用添加到几个系统组件得到它来编译。

I created a project Breeze.WebApi.EF6 and added a class EF6ContextProvider.cs that was pretty much a direct copy of the EFContextProvider.cs in the official Breeze.WebApi.EF project. The only real changes were to rename the namespace and the class, and adjust the using statements for EF6 (the code is too long to post). This project has NuGet references to Breeze.Server.WebApi.Core and EntityFramework - the Breeze package pulls in a bunch of dependencies, and I had to add references to a couple of system assemblies to get it to compile.

然后,在我的MVC /项目的WebAPI我只是为 Breeze.Client 的NuGet引用和 Breeze.Server.WebApi.Core 及项目参照 Breeze.WebApi.EF6 项目。

Then, in my MVC/WebAPI project I just had NuGet references for Breeze.Client and Breeze.Server.WebApi.Core and a project reference to the Breeze.WebApi.EF6 project.

显然,这是一个黑客位的。我创建了一个<一个href=\"http://breezejs.uservoice.com/forums/173093-breeze-feature-suggestions/suggestions/5235784-support-entity-framework-6-with-webapi-1-net-4-\"相对=nofollow> UserVoice的官方支持项目。

Obviously this is a bit of a hack. I have created a UserVoice item for official support.

这篇关于如何我会用微风实体框架6 .NE​​T 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆