Questions tagged as 'entity-framework'

1
answer

Error in query in bank with Linq

Good evening! I'm trying to perform a query on a mysql table, using linq, and present that result in a gridview to the user. I have the table below: I'm not looking for all the columns in this table, just a few for this I'm using the code be...
asked by 09.06.2014 / 01:46
4
answers

Databases for different clients

I am learning MVC 4 and would like to know if there is a way to with only 1 model accessing different databases? For example, I have an online system and for each client I have a separate bank. What would be the best practice to do this?     
asked by 26.05.2014 / 14:54
1
answer

Map the same entity twice

I'm trying to map the same entity twice in another public class Conveniado { public int Id { get; set; } public string Nome { get; set; } [InverseProperty(nameof(ProcedimentoAgregado.ConveniadoDe))] public virtual ICollection...
asked by 29.09.2018 / 01:14
1
answer

Two classes mapping the same table with the Entity Framework

I'm trying to make entity map two classes to the same table this is possible? Scenario: My identity is decoupled (Eduardo Pires' tuto) from my domain and from the presentation layer on the domain layer I have a usuario...
asked by 17.01.2017 / 00:13
1
answer

How to change the type of the persisted class in an inherited model using the EntityFramework

I have the following inheritance classes schema, as an example: public class Veiculo { public int Id { set; get; } public string Descricao { set; get; } } public class Moto : Veiculo { } public class Carro : Veiculo { } That gener...
asked by 02.05.2014 / 04:27
1
answer

What are the differences in performance issues when using querys with EF vs ADO

What is the difference in performance when using the query methods the base SqlQuery<TElement> and ExecuteSqlCommand of EntityFramework in relation to directly using ADO.NET ? If there is a significant difference in perf...
asked by 06.04.2016 / 13:54
2
answers

Relationship between classes - (C # EntityFramework)

Hello, I have a Person class and an Address Class Ex. public class Pessoa { public int Id { get; set; } public string Nome { get; set; } ... public Endereco Endereco { get; set; } } public class End...
asked by 15.01.2016 / 21:50
1
answer

Transcribe SELECT for query expression LINQ

How can I reproduce the following query for LINQ expression? SELECT nome_empresa, Count(funcionarios.id_funcionario) AS qtdfuncionario, Count(id_colaborador) AS qtdcolaboradores FROM empresas JOIN func...
asked by 29.07.2015 / 16:08
2
answers

May cause cycles or multiple cascaded paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints

I have a class that will have two FKs pointing to the same table, so the Entity Framework returns the error:    Can cause cycles or multiple cascading paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY cons...
asked by 24.05.2017 / 01:48
2
answers

Publish application with Entity Framework + Mysql

I'm using Entity Framework to Mysql . I installed .Net Connector , and MySQL.Data.Entities . Locally is working normally. But when I go up to LocaWeb , it will not. The following error appears:    Can n...
asked by 12.11.2014 / 00:56