protected void SaveDetailEntities(List <DetailObjectInfo> detailList) { if (detailList == null) { return; } foreach (var detailInfo in detailList) { IDataAccessBase da = EntityFactory.GetEntityDataAccessByName(detailInfo.EntityName, detailInfo.AdditionalDataKey); da.AutoSave = false; if (detailInfo.FnName == RuleFunctionSEnum.Insert) { da.Insert(detailInfo.EntitySet, new InsertParameters()); } else if (detailInfo.FnName == RuleFunctionSEnum.Update) { da.Update(detailInfo.EntitySet, new UpdateParameters()); } else if (detailInfo.FnName == RuleFunctionSEnum.Delete) { da.Delete(detailInfo.EntitySet, new DeleteParameters()); } else { throw new Exception("Function " + detailInfo.FnName + " is not defined in DataAccessLayer"); } } }
public virtual int Delete(T entity) { return(_dataAccessBase.Delete(entity)); }
/// <summary> /// 根据id删除菜单 /// </summary> /// <param name="id"></param> /// <returns></returns> public bool DeleteMenu(int id) { return(_dbContext.Delete(id)); }