Questions tagged as 'code-first'

0
answers

Foreign Key No choice in DropDown

Good afternoon! I am implementing a small application like Code First and I have a situation where I need to create a new record in a table, using the primary key of another table. By default, when I generate the controller and views automa...
asked by 10.10.2018 / 22:42
0
answers

EF Code First Error MySQL

I'm doing codefirst using mysql. When I run the update-database the following problem occurs: Target database is: 'DBContext' (DataSource:. \ SQLEXPRESS, Provider: System.Data.SqlClient, Origin: Convention). System.Data.SqlClient.SqlExcep...
asked by 30.09.2018 / 02:41
0
answers

Entity insert without children are null - EF6

I have the following problem. I need to insert an entity that has populated children, but I can not be null in the children to insert only the parent entity because in the next lines of precise code of the children filled to insert them. I...
asked by 05.09.2018 / 19:57
1
answer

Types Conversion with Fluenti API in EF Core 2.1

I wonder if you can do the following conversion: public class Pessoa { public bool Ativo { get; set; } } public class PessoaMap: IEntityTypeConfiguration<Pessoa> { public virtual void Configure(EntityTypeBuilder<TEntity>...
asked by 02.08.2018 / 18:26
0
answers

How to Scaffolding an Unmapped Property (NotMapped)

I'm working with a MVC 5 project with Entity Framework , where through Code First I created a template class that has a field which does not exist in the database, in the case of the ConfirmPassword field. This field should appear in a...
asked by 07.04.2018 / 23:14
2
answers

Connection methods in ASP .NET [closed]

I am a beginner in ASP and C #. I have doubts and this is the real reason to ask here. Before you can read how the question policy is, understand that I am a beginner and really need help. I have a question of how to connect to my ASP applic...
asked by 21.02.2018 / 17:43
0
answers

Entity Code First Migrations can not find Microsoft.EntityFrameworkCore.Design

Hello, I'm working on a dotnet 4.5.1 project using EntityFramework with CodeFirst Migrations, I've added 1 new field to an entity and I'm trying to add a new migration, however the following error message appears: N�o foi poss�vel carregar arqu...
asked by 14.02.2018 / 13:49
0
answers

ASP.MVC ENTITY Code First (strange problem)

I do not know if I'm doing something wrong (probably yes). But EF is persisting the data in a DB and in a table that it creates alone. I've already repeated this step-by-step 2 times and the result is the same. 1-I create an MVC Web Soluti...
asked by 03.11.2017 / 19:00
0
answers

Acesar daughter class properties C #

Using code-first I generated the class: namespace take8.Models { using Newtonsoft.Json; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotation...
asked by 03.06.2017 / 22:46
0
answers

Error using NuGet Package Manager in VS 2017

I installed VS 2017 community 2017 and give this error when I need to use the Nuget Package Manager? PM> enable-migrations enable-migrations : O termo 'enable-migrations' não é reconhecido como nome de cmdlet, função, arquivo de script ou...
asked by 22.03.2017 / 11:25