- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
public void Insert(object obj, int id)
{
var a = Convert.ChangeType(obj, Types[id]);
var b = Convert.ChangeType(ObjectSets[id],ObjectSets[id].GetType());
b.GetType().GetMethod("AddObject").Invoke(b,new []{ a });
}
public void Delete(object obj, int id)
{
var a = Convert.ChangeType(obj, Types[id]);
var b = Convert.ChangeType(ObjectSets[id], ObjectSets[id].GetType());
b.GetType().GetMethod("DeleteObject").Invoke(b, new[] { a });
}
Рефлексия и Entity Framework. Продолжение