Questions tagged as 'entity-framework-6'

0
answers

EF - A member of the type, 'X', does not have a corresponding column in the data reader with the same name

Good, I'm using EntityFramework to pass the result of this query: SELECT a.* FROM [Logística$Sales Invoice Header] AS a INNER JOIN [Logística$Sales Invoice Line] AS b ON a.No_ = b.[Document No_] WHERE 1 = 1 AND b.Type = 2 AND a.[Bill-to Cus...
asked by 01.02.2018 / 11:40
1
answer

Entity Framework creation of bank

I'm new to entity and I'm following a step-by-step guide to creating a Code First ( link ) . I created the application, debugged it and it runs perfectly without any errors, however no bank is created ... The main code follows the App.config...
asked by 19.01.2018 / 01:01
0
answers

Entity Framework (Database first) - Include DataAnnotations

I saw in an MS link that it is possible to create a partial and a Metadata class to include DataAnnotations in properties created by the Entity Framework (database first). Well, I did as the example, but the application has an error:    The m...
asked by 28.12.2017 / 14:47
1
answer

Entity Framework. Select only 1 from a list in the Include?

I'm trying to get just 1 record from the Phones and Emails lists. var lista = Db.Oportunidades .Include(x => x.Conta.Proprietario) .Include(x => x.Conta.Contatos.Select(c => c.Telefones)) .Include(x => x.Conta.Contatos....
asked by 05.12.2017 / 21:49
0
answers

static dbContext with Entity Framework: Compensates or not?

Well, I use the Entity Framework and Code First to manage my data access, and I'm thinking of working with a single, static, global instance of my DataBaseContext. But I have two questions: What problems could occur with this type of usage?...
asked by 23.10.2017 / 18:45
0
answers

Access FK attribute in Framewokr entity

I have the class Cliente which has a IList<Produto> and the produto class has a ClienteId (which is the FK) and a Cliente Cliente { get; set; } attribute. How do I access the Nome attribute of C...
asked by 16.10.2017 / 23:26
1
answer

Why does the one-to-many relationship in the Entity Framework default default work?

[Table(name: "cliente", Schema = "estudo")] public class Cliente : Base { [Key, Column("COD_CLIENTE")] [Required] public override Int64 Id { get; set; } [Column("CLI_NOME")] [Required] public virtual String Nome { get; se...
asked by 14.10.2017 / 20:23
0
answers

ASP.NET MVC system does not bring newly registered data, only the oldest data on the production server

I have a system developed in ASP.NET MVC that has a registry of authors. The system works normally on my machine but when I upload it to the production environment it only brings back only the oldest records in the data list. The data...
asked by 02.10.2017 / 15:05
1
answer

EntityFramework: There is no mapping of the ObjectParameter object type to a native type managed provider

I'm developing an MVC application with Entity Framework in Code First. As my database has procedures, I chose to use SQLQuery to execute the procedures, but I'm getting away with this error: Não existe mapeamento do tipo de objeto System.D...
asked by 21.09.2017 / 19:46
0
answers

How to create composite key and ensure the same property in 2 model

I have 3 models public class UnidadeNegocio { public int Id { get; set; } public string Nome { get; set; } } public class Cliente { public int Id { get; set; } public int UnidadeNegocioId { get; set; } public string Nome {...
asked by 10.09.2017 / 00:42