public int SaveExtendField(int siteId, ExtendFieldDto dto) { ISite site = this._resp.GetSiteById(siteId); if (site == null) throw new Exception("站点不存在"); IExtendField field = this._extendResp.CreateExtendField(dto.Id, dto.Name); field.CloneData(dto); return site.Extend.SaveExtendField(field); }
public IEnumerable<ExtendFieldDto> GetExtendFields(int siteId) { ISite site = this._resp.GetSiteById(siteId); ExtendFieldDto dto; IEnumerable<IExtendField> extends = site.Extend.GetAllExtends(); foreach (IExtendField extend in extends) { dto = new ExtendFieldDto().CloneData(extend); dto.Id = extend.Id; yield return dto; } }