Questions tagged as 'entity-framework'

2
answers

When consuming a service, error occurs in fields float or double in the BD

When I use the update service, this error occurs:    The 'DataLib' property on 'Release' could not be set to   'System.Double' value. You must set this property to a non-null value   of type 'System.Single' This error happens when [Rout...
asked by 14.09.2017 / 20:45
1
answer

Doubt in the Declaration of Type of Object - Entity Framework

I need help defining the correct class declaration Follow my code: public void BuscaOcorremcias() { //Op 01 - Declarando um IList da Model IList<Ocorrencia> ocorrencias = null; //Op 02 - Declarando um DbSet System.Data...
asked by 24.03.2017 / 20:18
1
answer

error with EF and Mysql query

I have the following query: var produto = (from a in context.ItensReceita join b in context.Receita on a.t0080_id_receita equals b.t0080_id_receita join c in context.Medicamento on a.t0080_id_receita equals c.t...
asked by 09.02.2017 / 11:15
1
answer

Required validating property of another object

I have the following properties, but when I am going to validate via ModelState.IsValid it returns that the description of the user group being informed that it is UserId too, but the problem is that I am prompting for the bank itself to generat...
asked by 27.10.2015 / 01:40
2
answers

How to do a Code First migration without deleting data from the table attribute?

I need to change the name of the Weight attribute to Product Weight , this is the code that is generated after running the add-migration command: namespace Web.Dominio.Migrations { using System; using System.Data.Entity.Migrations...
asked by 30.10.2016 / 20:09
2
answers

Handling related data Asp.net and C #

I'm developing an ASP.NET application, which aims to register events and add clients to these registered events, forming a list of clients for each event. My question is this: In the Events table there are three types of input (integer type -...
asked by 03.08.2014 / 16:52
1
answer

What is the most efficient way to get an Entity property?

I'm using EF6 and would like to know how to get the best performance by redeeming a single property from a Entity . Assuming the following case:    Let's say I need to fetch all names from a 5000-line user table. User.c...
asked by 20.12.2018 / 19:18
3
answers

Help with SqlQuery in context Entity Framework

I need to make a return of my database in a specific way, however I have a problem, the situation is as follows: I have this query already tested directly on SQL Server , and it is working perfectly: SELECT COUNT (ate.id) AS data,...
asked by 13.11.2018 / 16:28
2
answers

one for many and many for an Entity Framework

I'm developing these classes in this diagram, but I'm not sure how to declare relationships [One for many, many for one] Here's the diagram: forexampleProducthasaCategory,andCategoryhasseveralProducts:publicclassProduto{[Key]publicintCodigo{...
asked by 25.10.2017 / 21:57
1
answer

Error performing LINQ query with equals at where closure

When you run the query below: public ActionResult GridViewPartial() { if (Session["cod_cli"] != null) { int cod_cli = Convert.ToInt32(Session["cod_cli"]); //var model = db.DadosTecnicos;...
asked by 31.07.2017 / 14:02