public static object GetEntity(string typeName, object pk) { var type = SiteObject.GetType(typeName); if (type == null) { return(null); } pk = LinqToSqlUtils.CorrectPKType(pk, type); var entity = type.Create(); LinqToSqlUtils.SetPK(entity, pk); return(entity); }
public void InsertAndSubmit(T obj) { LinqToSqlUtils.SetPK(obj, GetMaxId() + 1); _source.Add(obj); }