sGermosen sGermosen - 1 year ago 54
C# Question

Trying to Add an "AND" condition to LINQ using Entity

Im trying to add and condition to my LING using entity, but it said that error,

Severity Code Description Project File Line Suppression State
Error CS0019 Operator '&&' cannot be applied to operands of type
'bool' and
'int' Backend E:_PsDESARROLLO\PsInternalDEV\Backend\Areas\Medicals\Controllers\PatientsController.cs 35 Active

Does anybody know how to solve this issue?

var patient = _db.Patients.Where(p => p.Person.AuthorId == authorId && p.Person.StatusId=1);

Answer Source

Missing = here:


Change it as:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download