Questions tagged as 'entity-framework'

1
answer

Error saving entity framework

I have a very basic problem, but I must be short of coffee to understand what is happening. I have an entity like this: public class Client : BaseEntity<Client> { [Required] public string CorporateName { get; set; } // V...
asked by 20.04.2017 / 00:29
1
answer

Error when restoring external application bank asp.net mvc

I am trying to restore a SQL database that I created in a provider that does not have the WebDeploy option. And my goal is to initialize a database using ASP.NET MVC with EntityFramework . Well, when setting the server and...
asked by 17.05.2017 / 01:59
1
answer

Foreingkey is not updated

I am not able to change a foreingkey field in the database. In my case, the objects (TypeEndereco = 3 and Endereco = 2) already exist. Follow the template (simple): public class Endereco { public int Id { get; set; } public string C...
asked by 17.05.2017 / 19:27
2
answers

Login with Asp.net 4.5 (Entity Framework)?

How can I make a Select using Entity Framework , and check if the registry exists? Example: txtlogin.text txtsenha.text Login table. user field password field valida() class created to execute the command and se...
asked by 23.03.2017 / 16:22
1
answer

Error: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details

The following error occurs when I try to insert data into the system: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details . It turns out that the error happens when it arrives at the following line...
asked by 29.08.2017 / 23:51
1
answer

How to execute SQL with Entity Framework?

I tried to run a SQL command by Entity Framework , I tried the following ways: string cmd = "UPDATE t0071_compra SET t0071_status = 'Enviado' WHERE t0071_id_compra = 4 AND t0020_id_empresa = 1"; context.Database.SqlQuery<string...
asked by 24.01.2017 / 20:31
1
answer

How do I reference the Entity Framework 6 from the .Net Core Class Library?

When installing the Entity Framework from Nuget I get the following error in your reference:    The dependency EntityFramework 6.1.3 does not support framework .NETCoreApp, Version = v1.6 How to work around this error? If anyone can help,...
asked by 15.02.2017 / 02:37
1
answer

How to use the Contains method in a search using the EntityFramework

I am trying to query sql , using EntityFramework : select * from pedidos where pedidoID not in (select pedidoID from agendamentos); I did some research and found that the EntityFramework method that replaces the not in of sql i...
asked by 22.02.2017 / 22:14
1
answer

What implementation would I use to initialize the data in the bank using 1: N relationship?

My intention is to initialize a SubCategoria , but it needs a Categoria first (1: N). I wanted to know what implementation I would use for this relationship to work fine in the database? I'm using the Seed method of EntityFra...
asked by 18.01.2017 / 19:58
1
answer

Error accessing array indexes inside a LINQ expression

I am doing a query to search all the meteorologies with a certain date, but when executing the following error occurs: An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user co...
asked by 13.11.2016 / 18:19