Questions tagged as 'entity-framework'

1
answer

Mysql Connection Does Not Appear in Data Connection

I've updated my Visual Studio to 2017 and am trying to connect to a MySQL database through the Entity Framework. What happens is that the option to connect to MySQL does not appear: OnlySQLServerappears.IhavealreadyinstalledtheConnector/Nett...
asked by 30.03.2017 / 03:27
1
answer

MIgrations, Updating a null field to not null

I'm updating the phone and CPF field of my User entity that was allowing nulls to non-null. follow the migration file public partial class Required_fild_users_cpf_phone : DbMigration { public override void Up() { AlterColumn("d...
asked by 01.12.2017 / 14:38
1
answer

How to use ViewModel in MVC 5 C # with Entity Framework?

I'm trying to learn how to use the ViewModel concept, so I did a basic project, but I'm having difficulty. I have the following Models: Person id type document Physics id name surname document Juridica id...
asked by 02.09.2017 / 01:50
3
answers

LINQ with JOIN and where clause, how to do?

Good afternoon. I'm trying to make a left outer join (SQL) with LINQ, however, I'm not getting it. The code for my class, this is below. Can anyone give me a light on how to solve this? public class PessoaController : Controller {...
asked by 01.01.2018 / 17:46
2
answers

LINQ using function within select new {} with lambda expression

I am assembling a select, with the Entity Framework, that needs to "create a column" according to 4 criteria. I'm trying this way: IQueryable<ImoveisDTO> Resultado = ctx.Imoveis.Select(ib => new ImoveisDTO { idImovel = ib.idImovel...
asked by 04.01.2018 / 13:04
1
answer

Analogy between OOP and database

I've been reading about the Entity Framework, which has the capabilities to turn classes into tables and objects into rows. I found it super interesting! To what extent is this analogy valid? If so, then what would be the analog of an interfa...
asked by 31.07.2018 / 06:22
1
answer

Do a join make the search faster?

I have two tables, one for patients and one for queries. In summary, the tables have the following structure: Patients int id; string nome; string cartaoSus; Queries int id; int idPaciente; dateTime data; When I want a patient r...
asked by 05.07.2017 / 15:11
1
answer

Doubt regarding good practices with virtual properties

I have a project that contains my classes that represent my entities in my DB. So, as an example goes there: In the Endereco table, I get a FK of Bairro(IdBairro) . To best represent my POCO , what is the best or onl...
asked by 01.07.2016 / 20:02
1
answer

What is Associative Table?

Well, I see some examples of codes using associative tables. But I'm not sure what this term means, its applicability, concept etc ... What is an associative table?     
asked by 27.12.2016 / 20:30
1
answer

Persisting in batch in Many-to-Many Entity with extra fields

I have the following question: If I have a relationship N for N ex: Products and Coins. Whenever it persists, there would be 1 Product with a list of 10 Coins. public class Produto { public int ProdutoId { get; set; } public string Nom...
asked by 17.05.2017 / 18:42