Questions tagged as 'entity-framework-6'

2
answers

Include all child objects (navigation properies) in entity search

I wonder if it is possible to fetch the fully populated object without having to call include by specifying each child object (with their respective children) in my class. Currently, I'm doing this: dbContext.Ocorrencia.Include("Pe...
asked by 17.03.2017 / 23:08
1
answer

A specified Include path is not valid. The EntityType 'Model.User' does not declare a navigation property with the name 'Connections'

I'm following this example to maintain connection and user information in a database. Then I created 2 tables: dbo.User: dbo.Connection: These2tablesaboveareverysimple.Ijustcreateditasaprimarykey.SoIcreatedanew"ADO.NET Entity Dat...
asked by 14.03.2017 / 07:58
1
answer

Remove creation of serial column EntityFramework + Npgsql

Hello, I'm creating an application using Fluent API + Entityframework. However in my domain classes when determining that a property is PK it automatically defines it as serial, I would not like to get this behavior because it will automatically...
asked by 25.10.2016 / 03:30
1
answer

Problem accessing List of a query

I'm starting today with Entity-FrameWork but I came across a problem that I think is simple, but I could not find the answer anywhere, maybe because I was not really sure what to look for. The code is as follows: using(var db = new...
asked by 12.05.2016 / 23:17
1
answer

Doubt with EntityFramework (Migration)

I'm trying to get my code to run, but I'm not getting through this Error    Severity Code Description Project File Line   Error CS0311 The type 'InternalControl.Migrations.InternalControl.IntContext' can not be used as the 'TContext' type par...
asked by 30.09.2015 / 02:44
1
answer

LEFT Outer Join does not work in LINQ when 0 is the reference? only null

I'm having doubts on Left Outer Join, I'm using MVC 5 C #, Net 4.5.2. I have the Next Model Supplier public class fechamentoFornecedor { public int FornecedorId { get; set; } public int Tipo { get; set; } publ...
asked by 26.02.2016 / 15:09
1
answer

"arithmetic exception, numeric overflow, or string truncation string right truncation" in search using LINQ

I have a table in a Firebird database CREATE TABLE CIDADE ( CID_CD SMALLINT NOT NULL, CID_DS CHAR(20) NOT NULL, CID_UF CHAR(2) NOT NULL, CID_DISTANCIA_SEDE SMALLINT NOT NULL, CID_CD_ALTERNATIVO INTEGER...
asked by 08.01.2016 / 17:13
2
answers

EntityFramework complaining of duplicate identifier even with property being null

I have the following classes: Product : public class Produto { [Key] public int Id { get; set; } [MaxLength(70)] [Required(AllowEmptyStrings = false)] public string Descricao { get; set; } [MaxLength(10)] [R...
asked by 08.05.2015 / 21:08
1
answer

What is the correct way to declare the following class structure and get its behavior from EntityFramework?

I have the following class structure: public class Revenda { [InverseProperty("Revenda")] public virtual ICollection<UsuarioRevenda> Usuarios { get; set; } } public class Empresa { [InverseProperty("Empresa")] public v...
asked by 30.09.2014 / 23:30
1
answer

Entity Framework Left Join

Seeing the question Left join with lambda GroupJoin and with condition , I came up with doubts around the way I do the Left Join with linq Having the following entities public class Cidade { public int CidadeId { get; s...
asked by 12.02.2015 / 13:45