I have the following query in LINQ
var dados = _db.Contratos
.Where(a => a.Adesoes.Any(b => b.Pago))
.Select(a => new
{
Contrato = a.Numero,
ValorTASenior = a.Adesoes.Where(b => b.Pago).Sum(b => b.Val...
I have a Client Model and need to update on EnviadoEmailCobranca para 0
I'm doing this:
var clientes = db.Clientes.Where(w => w.Status == 4);
foreach (var item in clientes)
{
item.EnviadoEmailCobranca = false;...
Let's say I want to model an application in .NET using EntityFramework as ORM and use one of its advantages, be "generic" for several RDBMS .
So, for example, I want my application to accept working with Firebird ,...
My system exists a class that is currently a common class for various situations, below some of the other models to exemplify
public class Servico
{
public int Id {get;set;}
public string Nome {get;set;}
public decimal? Valor {get;set...
I'm trying to persist a change I make in a registry, but I'm getting this error:
System.InvalidOperationException: 'A referential integrity constraint
violation occurred: The property value (s) of
'UnitMedida.UndMedidaId' on one end of...
I created a C # WEB MVC5 project in Visual Studio 2013, installed the entity framework 6 and created my classes ("entities") as well as the DBContext with their DBsets.
Within WEB.Config I configured my connection string and in the DBContext...
I'm having the following problem when creating two auto relationships.
When you run the Update-Database the following error message appears:
Unable to determine the main end of an association between the
types 'Autorelação.Franquia'...
How to add properties (columns) in an N-N relation using EF?
For example, I have class Produto :
public class Produto
{
[Key]
public int ProdutoID { get; set; }
public string Descricao { get; set; }
public decimal Valo...
Work on a bill invoice project, in this project there is the Emissor entity.
My database Sql-Server may have multiple emitters.
Each issuer can issue its invoices.
Each invoice must have a unique, sequential number.
This seque...
I've been doing a data import for a project in ASP.NET MVC 5 with EF 6.1 and SQL Server 2008 where the source Import data was a txt file.
The file record lines were not very large but contained a certain amount of information to proce...