Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i recive this message when i run the below code.

What I have tried:

var querybase = this.GetAll(
                _ => _.PlanoServico,
                _ => _.Escola
                );
				
public virtual IQueryable<T> GetAll(params Expression<Func<T, object>>[] includes)
{
	IQueryable<T> query = ctx.Set<T>();
	return includes.Aggregate(query, (current, include) => current.Include(include)).AsNoTracking();
}
Posted
Updated 16-Jun-20 23:36pm
Comments
Richard Deeming 16-Jun-20 15:51pm    
Do you get the error without any includes? I suspect there may be a mapping error between your database and your EF entities.
Fernando_Costa 16-Jun-20 16:03pm    
I have a field float when i comment the field works

1 solution

The float type in C# maps to the real column type in SQL:
SQL Server Data Type Mappings - ADO.NET | Microsoft Docs[^]

Confusingly, the float data type in SQL maps to the double type in C#.

You'll need to modify your C# property to use the correct type that maps to the SQL column type.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900