How to check if object is sql to linq type
- by remdao
Hi, anyone know if there's any easy way to check if an object is an sql to ling type? I have a method like this but would like it to only accept valid types.
public static void Update(params object[] items)
{
using (TheDataContext dc = new TheDataContext())
{
System.Data.Linq.ITable table;
if(items.Length > 0)
table = dc.GetTable(items[0].GetType());
for (int i = 0; i < items.Length; i++)
{
table.Attach(items[i]);
dc.Refresh(System.Data.Linq.RefreshMode.KeepCurrentValues, items[i]);
}
dc.SubmitChanges();
}
}