0
嗨 我在線上發現此代碼,無法將其轉換爲vb。 我真的很感激,如果有人會將這個LINQ C#代碼轉換爲VB給我。 下面是代碼:請將此LINQ C#轉換爲VB
/// <summary>
///
/// </summary>
/// <returns></returns>
[DataObjectMethod(DataObjectMethodType.Select)]
public IEnumerable<Customer> FindByID(string id)
{
// find the customer
return (from c in this.Customers where c.ID == id select c).ToList();
}
/// <summary>
///
/// </summary>
/// <param name="customer"></param>
public void Update(Customer newValues)
{
// simulate putting this record back into the database
Customer oldValues = this.Customers.Find(x => x.ID == newValues.ID);
oldValues.CompanyName = newValues.CompanyName;
oldValues.ContactName = newValues.ContactName;
oldValues.ContactTitle = newValues.ContactTitle;
oldValues.Address = newValues.Address;
oldValues.City = newValues.City;
oldValues.State = newValues.State;
oldValues.ZIPCode = newValues.ZIPCode;
oldValues.Phone = newValues.Phone;
}
}
謝謝你洙多的是爲了我自己。 馬特