public List <DivisionTable> GetParent(string id) { var Id = new SqlParameter("Id", id); var iQueryTable = _dbContext.Set <DivisionTable>().FromSql("EXECUTE dbo.GetFullAddr @Id", Id); return(iQueryTable.ToList()); }
/// <summary> /// 增加多模型数据,指定独立模型集合 /// </summary> public virtual int SaveList <T1>(List <T1> t) where T1 : class { try { if (t == null || t.Count == 0) { return(0); } _dbContext.Set <T1>().Local.Clear(); foreach (var item in t) { _dbContext.Set <T1>().Add(item); } return(_dbContext.SaveChanges()); } catch (Exception e) { throw e; } }