public IHttpActionResult UpdateDynamicContent(webModel.DynamicContentItem contentItem)
        {
            var coreItem = contentItem.ToCoreModel();

            _dynamicContentService.SaveContentItems(new[] { coreItem });
            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult CreateDynamicContent(webModel.DynamicContentItem contentItem)
        {
            var coreItem = contentItem.ToCoreModel();

            _dynamicContentService.SaveContentItems(new[] { coreItem });
            return(GetDynamicContentById(coreItem.Id));
        }
Beispiel #3
0
        public static coreModel.DynamicContentItem ToCoreModel(this webModel.DynamicContentItem content)
        {
            var retVal = new coreModel.DynamicContentItem();

            retVal.InjectFrom(content);
            if (content.Properties != null)
            {
                retVal.Properties = content.Properties.Select(x => x.ToCoreModel()).ToList();
            }
            return(retVal);
        }
		public static webModel.DynamicContentItem ToWebModel(this coreModel.DynamicContentItem content)
		{
			var retVal = new webModel.DynamicContentItem();
			retVal.InjectFrom(content);
			if(content.Folder != null)
			{
				retVal.Outline = content.Folder.Outline;
				retVal.Path = content.Folder.Path;
			}
			retVal.DynamicProperties = content.DynamicProperties;
			return retVal;
		}
        public static coreModel.DynamicContentItem ToCoreModel(this webModel.DynamicContentItem content)
        {
            var retVal = new coreModel.DynamicContentItem();

            retVal.InjectFrom(content);
            retVal.DynamicProperties = content.DynamicProperties;
            if (content.DynamicProperties != null)
            {
                retVal.ContentType = retVal.GetDynamicPropertyValue <string>("Content type", null);
            }
            return(retVal);
        }
        public static webModel.DynamicContentItem ToWebModel(this coreModel.DynamicContentItem content)
        {
            var retVal = new webModel.DynamicContentItem();

            retVal.InjectFrom(content);
            if (content.Folder != null)
            {
                retVal.Outline = content.Folder.Outline;
                retVal.Path    = content.Folder.Path;
            }
            retVal.DynamicProperties = content.DynamicProperties;
            return(retVal);
        }
Beispiel #7
0
 public IHttpActionResult UpdateDynamicContent(webModel.DynamicContentItem contentItem)
 {
     _dynamicContentService.UpdateContents(new coreModel.DynamicContentItem[] { contentItem.ToCoreModel() });
     return(StatusCode(HttpStatusCode.NoContent));
 }
Beispiel #8
0
        public IHttpActionResult CreateDynamicContent(webModel.DynamicContentItem contentItem)
        {
            var retVal = _dynamicContentService.CreateContent(contentItem.ToCoreModel());

            return(GetDynamicContentById(retVal.Id));
        }