public ResourceBE UpdatePropertyContent(ResourceBE prop, ResourceContentBE content, string changeDescription, string eTag, AbortEnum abort, XUri parentUri, ResourceBE.ParentType parentType) { if (abort == AbortEnum.Modified) { _resourceBL.ValidateEtag(eTag, prop, true); } prop = _resourceBL.BuildRevForContentUpdate(prop, content.MimeType, content.Size, changeDescription, null, content); prop = _resourceBL.SaveResource(prop); DekiContext.Current.Instance.EventSink.PropertyUpdate(DekiContext.Current.Now, prop, DekiContext.Current.User, parentType, parentUri); return(prop); }
protected ResourceBE SaveResource(ResourceBE res) { ResourceBE ret = null; if (res.IsNewResource()) { //New attachments get a legacy fileid mapping. uint fileId = ResourceMapBL.GetNewFileId(); res.MetaXml.FileId = fileId; ret = _resourceBL.SaveResource(res); ResourceMapBL.UpdateFileIdMapping(fileId, ret.ResourceId); } else { ret = _resourceBL.SaveResource(res); } return(ret); }