entity-framework

Entity Framework 5 - Could not load file or assembly EntityFramework, Version=5.0.0.0

你说的曾经没有我的故事 提交于 2020-01-14 07:06:50
问题 I am trying to use Entity Framework 5 for my project but I seem to be having some issue getting the assembly installed to comply. And since I installed this initially using nuget, I am not certain what I need to do to cause this to work as I expect . Any help on what I need to do to fix this problem please? * System.IO.FileNotFoundException : Could not load file or assembly EntityFramework, Version=5.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089' or one of it's dependencies The

Entity Framework 5 - Could not load file or assembly EntityFramework, Version=5.0.0.0

孤者浪人 提交于 2020-01-14 07:06:05
问题 I am trying to use Entity Framework 5 for my project but I seem to be having some issue getting the assembly installed to comply. And since I installed this initially using nuget, I am not certain what I need to do to cause this to work as I expect . Any help on what I need to do to fix this problem please? * System.IO.FileNotFoundException : Could not load file or assembly EntityFramework, Version=5.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089' or one of it's dependencies The

ER diagram - Project, Task and Employee

只愿长相守 提交于 2020-01-14 06:03:30
问题 UPDATE: Company can have multiple Projects and Company also have Employees. An employee can only have one Company and a Project can also have only one company. A project has several tasks. Out of these tasks, an Employee will only be assigned to some of the tasks. The employee can only be assigned tasks for project that he/she is assigned to. Please review the following and help on how I should create the database design and the final entity model UPDATED DIAGRAM based on the two comments: If

ER diagram - Project, Task and Employee

喜夏-厌秋 提交于 2020-01-14 06:02:04
问题 UPDATE: Company can have multiple Projects and Company also have Employees. An employee can only have one Company and a Project can also have only one company. A project has several tasks. Out of these tasks, an Employee will only be assigned to some of the tasks. The employee can only be assigned tasks for project that he/she is assigned to. Please review the following and help on how I should create the database design and the final entity model UPDATED DIAGRAM based on the two comments: If

How to display data from database to ListView in WPF C#

给你一囗甜甜゛ 提交于 2020-01-14 05:54:26
问题 I'm trying to display data from my Entitity Framework database to my ListView in my WPF C# application. I'm using WCF app as my host, where I keep my methods for displaying data, adding data, etc., and I have WPF app as my client, where I use the code to display data from database to my ListView. This is my code ServiceReference1.ImojWCFServiceClient client = new ServiceReference1.ImojWCFServiceClient(); listView1.Items.Clear(); var userList = client.getUsers(); foreach (var user in userList)

Problems calling a stored procedure using Entity Framework: expects parameter not supplied

旧时模样 提交于 2020-01-14 05:23:27
问题 I have the following stored procedure: CREATEA PROCEDURE USP_U_Pricing ( @ProductId int ) AS BEGIN .... END I setup the DbParameter like this: var pProductId = dataProvider.GetParameter(); //This returns a DbParameter pProductId.ParameterName = "@ProductId"; pProductId.Value = productId; pProductId.DbType = DbType.Int32; And call the procedure like This: this.Database.SqlQuery<TEntity>("USP_U_Pricing", parameters).ToList(); Where pricing is the SP name and parameters an array that contains

EF 4: Problems understanding DetectChanges when using POCO (no self tracking ObjectContext)

荒凉一梦 提交于 2020-01-14 05:21:27
问题 I wonder if anyone can help me? I am having problems understanding why i need to issues DetectChanges on my POCO (non proxy) entities. Of course i have this line to ensure that proxies are not returned. context.ObjectStateManager.GetObjectStateEntry(order).State And doing some research it appears if i need to check the "state" of an object then i need to issue detechChanges But why would i need to check the State of an object? Basically I send along my POCO entity to a method that SAVES the

ASP.NET MVC : Context type not found in assembly

别等时光非礼了梦想. 提交于 2020-01-14 04:53:06
问题 This is my first asp.net mvc project. I used EF code first approach and created a separate class library to write my model and context. I also referenced the class library in mvc project. But now after creating few more new models when I try to enable migration, it gives me an error. I also tried all the possible solutions mentioned here : No context type found in the assembly. ASP.NET MVC4 Still problem remains the same. Am I missing something? This is code for Context Class: using System;

How to use code first migrations with Azure App Service

假装没事ソ 提交于 2020-01-14 04:41:09
问题 When I run locally I run the commands below manually and then package and publish the app onto my IIS server. Add-Migration Initial Update-Database When I want to publish to an azure appservice will these commands run automatically? If so how does it know to use a different ConnectionString when I publish it to azure? I added the connectionString for azure in appsettings.json but I don't understand how I can tell my controllers etc to use that when I publish to azure AppServices

MVC Model How to make byte[] nullable?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-14 04:27:06
问题 I'm using ASP.NET MVC with EF code first. In my model I have a property that can be null: public byte[] Avatar { get; set; } However, when I run update-database I get: Cannot insert the value NULL into column 'Avatar', table 'temp'; column does not allow nulls. UPDATE fails. I don't have a dataannotation specifying the property to be required, nor is the property a foreign key. Any ideas? Further updates: If I delete my database and force a new one to be created with 'update-database -verbose