Friday

linq join on multiple fields by OR sample

Linq doesn't allow to do on t1.field1=t2.field1 or t1.field2=t2.field2
therefor it can be done by using OR in where statement:
     
var profiles = (from b in invoiceContext.bills
join p in invoiceContext.PaymentProfiles on 1 equals 1
where b.ProfileID == p.Id || b.ProfileType == p.Id
select p.Name).ToList();

No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...