Wednesday

C# linq transfer data between linq object and business layer object sample

public class myClass
{
public int RecordID { get; set; }
public string Field1 { get; set; }
}

public void GetDataAndCallBusinessMethod()
{
using (DBDataContext db = new DBDataContext)
{
IEnumerable<myClass> Recs =
from tab in db.table
select new myClass
{
RecordID = tab.RecordID,
Field1 = tab.Field1
};
BusinessLayer.Businessmethod(Recs);
}
}

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 ...