Questions tagged as 'code-first'

1
answer

ASP.NET MVC How to Manipulate Table Users Using Code First

I am studying MVC ASP.NET code first . I am a beginner and I have a probably basic doubt. When you start a project, it already creates a basic application, including the User table. I happen to want to make a relationship between this User ta...
asked by 13.03.2017 / 09:47
1
answer

C # decimal field in Form

Simple question: I have a Decimal field of type Currency in my model. It happens that when I enter a decimal value in the form field, it arrives as integer in the Controller: Example: KM Value Rounded: 0.41 Arrives on Controller: 41...
asked by 18.06.2015 / 03:34
0
answers

Migration does not recognize the Context

I'm developing an application using DDD architecture. In my Infra layer, I have my data models, all based on Code First . I am using SQL as the database. I already installed everything that was needed. It turns out that when I try to apply...
asked by 03.10.2018 / 16:56
0
answers

How to use the GraphDiff Entity Framework Code First

I have the following tables in my database: Sale Sales Details Products Sales Plots The relationship is as follows: 1 Sale = > N Sales Details 1 Sale = > N Products Sales 1 Sales Details = > N Plots I'm trying to...
asked by 11.06.2018 / 14:31
1
answer

MIgrations error loading System.Configuration.ConfigurationManager - MIgrations

I have a WPF project that contains a app.config containing the consection string and tb I have a Date layer of type ClassLibrary .dot net Standard on which to create the Migrations folder. When I give an "Add-Migration Start" the syste...
asked by 11.01.2018 / 00:37
1
answer

ASP.NET MVC + Entity - Mapping New Tables

Good morning, I have a project using ASP.MVC + EF and I mapped about 20 tables using the VS wizard (creating ADO.NET Entity Data Model , selecting the database and tables I want), but now I have 16 more tables to insert in...
asked by 23.08.2017 / 14:33
0
answers

Error cast on return of Entity Framework 6 [closed]

I have two entities that inherit from the same abstract class. public class Empresa : PessoaJuridica { private Empresa() { } public Empresa(string CNPJ, string RazaoSocial, Status Situacao, byte MaxNumeroUsuarios) {...
asked by 08.03.2017 / 22:33
0
answers

Many Relationship to Many Entity Framework Code First Composite Primary Keys Repeated Column

In my application I have two entities with a many-to-many relationship, namely Activity and Skill : EF(CodeFirst)generatesthejointableforme,butitisconflictingifIcreatethemappingathandinOnModelCreatingbecauseIhavethesamecolumn(CLIENT_ID)in...
asked by 16.02.2017 / 11:58
1
answer

MySql with entity framework Code First ID jumping 10

I'm setting up a MySql in Azure for an application I'm working on, however saving my records to identity column is increasing by 10. Would this be an entity-adjustable setting or an adjustment made for all tables directly in the da...
asked by 29.07.2015 / 22:09
0
answers

Error Publishing Locaweb - ASP.NET with MySql

I posted a site on Locaweb: .Net + MySql + MVC 4 + EF6 For more details on the error: link Detail: Location runs normally. But when I published, the following occurs: 'Cannot perform CAS Asserts in Security Transparent methods'    ...
asked by 23.07.2015 / 08:20