diff --git a/src/Umbraco.Core/ConfigurationEditor.cs b/src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs
similarity index 98%
rename from src/Umbraco.Core/ConfigurationEditor.cs
rename to src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs
index 43de192914..e40db6e3cd 100644
--- a/src/Umbraco.Core/ConfigurationEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
-using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Serialization;
-namespace Umbraco.Core
+namespace Umbraco.Core.PropertyEditors
{
///
/// Represents a data type configuration editor.
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DataValueReferenceFactoryCollection.cs b/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs
similarity index 92%
rename from src/Umbraco.Infrastructure/PropertyEditors/DataValueReferenceFactoryCollection.cs
rename to src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs
index 2737dcfef1..1dadd6cf0a 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/DataValueReferenceFactoryCollection.cs
+++ b/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollection.cs
@@ -25,7 +25,7 @@ namespace Umbraco.Core.PropertyEditors
//TODO: We will need to change this once we support tracking via variants/segments
// for now, we are tracking values from ALL variants
- foreach(var propertyVal in p.Values)
+ foreach (var propertyVal in p.Values)
{
var val = propertyVal.EditedValue;
@@ -33,9 +33,9 @@ namespace Umbraco.Core.PropertyEditors
if (valueEditor is IDataValueReference reference)
{
var refs = reference.GetReferences(val);
- foreach(var r in refs)
+ foreach (var r in refs)
trackedRelations.Add(r);
- }
+ }
// Loop over collection that may be add to existing property editors
// implementation of GetReferences in IDataValueReference.
@@ -48,14 +48,11 @@ namespace Umbraco.Core.PropertyEditors
// in the dataeditor/property has referecnes to media/content items
if (item.IsForEditor(editor))
{
- foreach(var r in item.GetDataValueReference().GetReferences(val))
+ foreach (var r in item.GetDataValueReference().GetReferences(val))
trackedRelations.Add(r);
}
-
}
}
-
-
}
return trackedRelations;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DataValueReferenceFactoryCollectionBuilder.cs b/src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionBuilder.cs
similarity index 100%
rename from src/Umbraco.Infrastructure/PropertyEditors/DataValueReferenceFactoryCollectionBuilder.cs
rename to src/Umbraco.Core/PropertyEditors/DataValueReferenceFactoryCollectionBuilder.cs
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/DecimalConfigurationEditor.cs b/src/Umbraco.Core/PropertyEditors/DecimalConfigurationEditor.cs
similarity index 90%
rename from src/Umbraco.Infrastructure/PropertyEditors/DecimalConfigurationEditor.cs
rename to src/Umbraco.Core/PropertyEditors/DecimalConfigurationEditor.cs
index 207a82844d..efb1df1eb7 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/DecimalConfigurationEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/DecimalConfigurationEditor.cs
@@ -1,5 +1,4 @@
-using Umbraco.Core;
-using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
namespace Umbraco.Web.PropertyEditors
@@ -7,7 +6,7 @@ namespace Umbraco.Web.PropertyEditors
///
/// A custom pre-value editor class to deal with the legacy way that the pre-value data is stored.
///
- internal class DecimalConfigurationEditor : ConfigurationEditor
+ public class DecimalConfigurationEditor : ConfigurationEditor
{
public DecimalConfigurationEditor()
{
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/IDataValueReference.cs b/src/Umbraco.Core/PropertyEditors/IDataValueReference.cs
similarity index 96%
rename from src/Umbraco.Infrastructure/PropertyEditors/IDataValueReference.cs
rename to src/Umbraco.Core/PropertyEditors/IDataValueReference.cs
index 6377098bfc..8c0806a4a4 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/IDataValueReference.cs
+++ b/src/Umbraco.Core/PropertyEditors/IDataValueReference.cs
@@ -13,6 +13,6 @@ namespace Umbraco.Core.PropertyEditors
///
///
///
- IEnumerable GetReferences(object value);
+ IEnumerable GetReferences(object value);
}
}
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/IDataValueReferenceFactory.cs b/src/Umbraco.Core/PropertyEditors/IDataValueReferenceFactory.cs
similarity index 90%
rename from src/Umbraco.Infrastructure/PropertyEditors/IDataValueReferenceFactory.cs
rename to src/Umbraco.Core/PropertyEditors/IDataValueReferenceFactory.cs
index 6587e071bf..c13c1ed212 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/IDataValueReferenceFactory.cs
+++ b/src/Umbraco.Core/PropertyEditors/IDataValueReferenceFactory.cs
@@ -5,7 +5,7 @@
///
/// Gets a value indicating whether the DataValueReference lookup supports a datatype (data editor).
///
- /// The datatype.
+ ///
/// A value indicating whether the converter supports a datatype.
bool IsForEditor(IDataEditor dataEditor);
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/IntegerConfigurationEditor.cs b/src/Umbraco.Core/PropertyEditors/IntegerConfigurationEditor.cs
similarity index 90%
rename from src/Umbraco.Infrastructure/PropertyEditors/IntegerConfigurationEditor.cs
rename to src/Umbraco.Core/PropertyEditors/IntegerConfigurationEditor.cs
index e80c0fcb0e..bb1f8af790 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/IntegerConfigurationEditor.cs
+++ b/src/Umbraco.Core/PropertyEditors/IntegerConfigurationEditor.cs
@@ -1,5 +1,4 @@
-using Umbraco.Core;
-using Umbraco.Core.PropertyEditors;
+using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
namespace Umbraco.Web.PropertyEditors
@@ -7,7 +6,7 @@ namespace Umbraco.Web.PropertyEditors
///
/// A custom pre-value editor class to deal with the legacy way that the pre-value data is stored.
///
- internal class IntegerConfigurationEditor : ConfigurationEditor
+ public class IntegerConfigurationEditor : ConfigurationEditor
{
public IntegerConfigurationEditor()
{
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ListViewConfiguration.cs b/src/Umbraco.Core/PropertyEditors/ListViewConfiguration.cs
similarity index 84%
rename from src/Umbraco.Infrastructure/PropertyEditors/ListViewConfiguration.cs
rename to src/Umbraco.Core/PropertyEditors/ListViewConfiguration.cs
index ce41628ec1..083e36029e 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ListViewConfiguration.cs
+++ b/src/Umbraco.Core/PropertyEditors/ListViewConfiguration.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using System.Runtime.Serialization;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
@@ -31,7 +31,7 @@ namespace Umbraco.Web.PropertyEditors
new Layout { Name = "grid", Icon = "icon-thumbnails-small", IsSystem = 1, Selected = true, Path = "views/propertyeditors/listview/layouts/grid/grid.html" }
};
- IncludeProperties = new []
+ IncludeProperties = new[]
{
new Property { Alias = "sortOrder", Header = "Sort order", IsSystem = 1 },
new Property { Alias = "updateDate", Header = "Last edited", IsSystem = 1 },
@@ -41,7 +41,7 @@ namespace Umbraco.Web.PropertyEditors
[ConfigurationField("pageSize", "Page Size", "number", Description = "Number of items per page")]
public int PageSize { get; set; }
-
+
[ConfigurationField("orderBy", "Order By", "views/propertyeditors/listview/sortby.prevalues.html",
Description = "The default sort order for the list")]
public string OrderBy { get; set; }
@@ -69,54 +69,57 @@ namespace Umbraco.Web.PropertyEditors
[ConfigurationField("showContentFirst", "Show Content App First", "boolean", Description = "Enable this to show the content app by default instead of the list view app")]
public bool ShowContentFirst { get; set; }
+ [DataContract]
public class Property
{
- [JsonProperty("alias")]
+ [DataMember(Name = "alias")]
public string Alias { get; set; }
- [JsonProperty("header")]
+ [DataMember(Name = "header")]
public string Header { get; set; }
- [JsonProperty("nameTemplate")]
+ [DataMember(Name = "nameTemplate")]
public string Template { get; set; }
- [JsonProperty("isSystem")]
+ [DataMember(Name = "isSystem")]
public int IsSystem { get; set; } // TODO: bool
}
+ [DataContract]
public class Layout
{
- [JsonProperty("name")]
+ [DataMember(Name = "name")]
public string Name { get; set; }
- [JsonProperty("path")]
+ [DataMember(Name = "path")]
public string Path { get; set; }
- [JsonProperty("icon")]
+ [DataMember(Name = "icon")]
public string Icon { get; set; }
- [JsonProperty("isSystem")]
+ [DataMember(Name = "isSystem")]
public int IsSystem { get; set; } // TODO: bool
- [JsonProperty("selected")]
+ [DataMember(Name = "selected")]
public bool Selected { get; set; }
}
+ [DataContract]
public class BulkActionPermissionSettings
{
- [JsonProperty("allowBulkPublish")]
+ [DataMember(Name = "allowBulkPublish")]
public bool AllowBulkPublish { get; set; } = true;
- [JsonProperty("allowBulkUnpublish")]
+ [DataMember(Name = "allowBulkUnpublish")]
public bool AllowBulkUnpublish { get; set; } = true;
- [JsonProperty("allowBulkCopy")]
+ [DataMember(Name = "allowBulkCopy")]
public bool AllowBulkCopy { get; set; } = true;
- [JsonProperty("allowBulkMove")]
+ [DataMember(Name = "allowBulkMove")]
public bool AllowBulkMove { get; set; } = true;
- [JsonProperty("allowBulkDelete")]
+ [DataMember(Name = "allowBulkDelete")]
public bool AllowBulkDelete { get; set; } = true;
}
}
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MemberPickerConfiguration.cs b/src/Umbraco.Core/PropertyEditors/MemberPickerConfiguration.cs
similarity index 89%
rename from src/Umbraco.Infrastructure/PropertyEditors/MemberPickerConfiguration.cs
rename to src/Umbraco.Core/PropertyEditors/MemberPickerConfiguration.cs
index 255be498bc..ba7dea6548 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/MemberPickerConfiguration.cs
+++ b/src/Umbraco.Core/PropertyEditors/MemberPickerConfiguration.cs
@@ -1,5 +1,5 @@
using System.Collections.Generic;
-using Umbraco.Core;
+using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MissingPropertyEditor.cs b/src/Umbraco.Core/PropertyEditors/MissingPropertyEditor.cs
similarity index 100%
rename from src/Umbraco.Infrastructure/PropertyEditors/MissingPropertyEditor.cs
rename to src/Umbraco.Core/PropertyEditors/MissingPropertyEditor.cs
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultiNodePickerConfiguration.cs b/src/Umbraco.Core/PropertyEditors/MultiNodePickerConfiguration.cs
similarity index 100%
rename from src/Umbraco.Infrastructure/PropertyEditors/MultiNodePickerConfiguration.cs
rename to src/Umbraco.Core/PropertyEditors/MultiNodePickerConfiguration.cs
diff --git a/src/Umbraco.Core/PropertyEditors/MultiNodePickerConfigurationTreeSource.cs b/src/Umbraco.Core/PropertyEditors/MultiNodePickerConfigurationTreeSource.cs
new file mode 100644
index 0000000000..749f46abc5
--- /dev/null
+++ b/src/Umbraco.Core/PropertyEditors/MultiNodePickerConfigurationTreeSource.cs
@@ -0,0 +1,21 @@
+using System.Runtime.Serialization;
+using Umbraco.Core;
+
+namespace Umbraco.Web.PropertyEditors
+{
+ ///
+ /// Represents the 'startNode' value for the
+ ///
+ [DataContract]
+ public class MultiNodePickerConfigurationTreeSource
+ {
+ [DataMember(Name = "type")]
+ public string ObjectType { get; set; }
+
+ [DataMember(Name = "query")]
+ public string StartNodeQuery { get; set; }
+
+ [DataMember(Name = "id")]
+ public Udi StartNodeId { get; set; }
+ }
+}
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentConfiguration.cs b/src/Umbraco.Core/PropertyEditors/NestedContentConfiguration.cs
similarity index 88%
rename from src/Umbraco.Infrastructure/PropertyEditors/NestedContentConfiguration.cs
rename to src/Umbraco.Core/PropertyEditors/NestedContentConfiguration.cs
index 89190883c8..e75be48f36 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/NestedContentConfiguration.cs
+++ b/src/Umbraco.Core/PropertyEditors/NestedContentConfiguration.cs
@@ -1,4 +1,4 @@
-using Newtonsoft.Json;
+using System.Runtime.Serialization;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
@@ -27,15 +27,17 @@ namespace Umbraco.Web.PropertyEditors
[ConfigurationField("hideLabel", "Hide Label", "boolean", Description = "Hide the property label and let the item list span the full width of the editor window.")]
public bool HideLabel { get; set; }
+
+ [DataContract]
public class ContentType
{
- [JsonProperty("ncAlias")]
+ [DataMember(Name = "ncAlias")]
public string Alias { get; set; }
- [JsonProperty("ncTabAlias")]
+ [DataMember(Name = "ncTabAlias")]
public string TabAlias { get; set; }
- [JsonProperty("nameTemplate")]
+ [DataMember(Name = "nameTemplate")]
public string Template { get; set; }
}
}
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/UserPickerConfiguration.cs b/src/Umbraco.Core/PropertyEditors/UserPickerConfiguration.cs
similarity index 95%
rename from src/Umbraco.Infrastructure/PropertyEditors/UserPickerConfiguration.cs
rename to src/Umbraco.Core/PropertyEditors/UserPickerConfiguration.cs
index 88eb1d224e..bf3cd197a3 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/UserPickerConfiguration.cs
+++ b/src/Umbraco.Core/PropertyEditors/UserPickerConfiguration.cs
@@ -1,5 +1,4 @@
using System.Collections.Generic;
-using Umbraco.Core;
using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs
similarity index 98%
rename from src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs
rename to src/Umbraco.Core/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs
index 8b3655f0cc..99bbe86dae 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/ContentPickerValueConverter.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
=> propertyType.EditorAlias.Equals(Constants.PropertyEditors.Aliases.ContentPicker);
public override Type GetPropertyValueType(IPublishedPropertyType propertyType)
- => typeof (IPublishedContent);
+ => typeof(IPublishedContent);
public override PropertyCacheLevel GetPropertyCacheLevel(IPublishedPropertyType propertyType)
=> PropertyCacheLevel.Elements;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/LabelValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
similarity index 95%
rename from src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/LabelValueConverter.cs
rename to src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
index eb461b4920..e706c198cf 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/LabelValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/LabelValueConverter.cs
@@ -65,9 +65,9 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
if (source is decimal sourceDecimal) return sourceDecimal;
if (source is string sourceDecimalString)
return decimal.TryParse(sourceDecimalString, NumberStyles.Any, CultureInfo.InvariantCulture, out var d) ? d : 0;
- if (source is double sourceDouble)
- return Convert.ToDecimal(sourceDouble);
- return (decimal) 0;
+ if (source is double sourceDouble)
+ return Convert.ToDecimal(sourceDouble);
+ return (decimal)0;
case ValueTypes.Integer:
if (source is int sourceInt) return sourceInt;
if (source is string sourceIntString)
@@ -76,7 +76,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
case ValueTypes.Bigint:
if (source is string sourceLongString)
return long.TryParse(sourceLongString, out var i) ? i : 0;
- return (long) 0;
+ return (long)0;
default: // everything else is a string
return source?.ToString() ?? string.Empty;
}
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
similarity index 98%
rename from src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
rename to src/Umbraco.Core/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
index 5405727791..9a33fd56e5 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
@@ -6,6 +6,7 @@ using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web.PublishedCache;
+
namespace Umbraco.Web.PropertyEditors.ValueConverters
{
///
@@ -67,7 +68,7 @@ namespace Umbraco.Web.PropertyEditors.ValueConverters
{
var isMultiple = IsMultipleDataType(propertyType.DataType);
- var udis = (Udi[]) source;
+ var udis = (Udi[])source;
var mediaItems = new List();
if (source == null) return isMultiple ? mediaItems : null;
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs
similarity index 100%
rename from src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs
rename to src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TinyMceValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
similarity index 97%
rename from src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
rename to src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
index c4e384e1e8..51471f6da7 100644
--- a/src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
+++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/TinyMceValueConverter.cs
@@ -14,7 +14,7 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
=> propertyType.EditorAlias == Constants.PropertyEditors.Aliases.TinyMce;
public override Type GetPropertyValueType(IPublishedPropertyType propertyType)
- => typeof (IHtmlEncodedString);
+ => typeof(IHtmlEncodedString);
// PropertyCacheLevel.Content is ok here because that converter does not parse {locallink} nor executes macros
public override PropertyCacheLevel GetPropertyCacheLevel(IPublishedPropertyType propertyType)
diff --git a/src/Umbraco.Infrastructure/PropertyEditors/MultiNodePickerConfigurationTreeSource.cs b/src/Umbraco.Infrastructure/PropertyEditors/MultiNodePickerConfigurationTreeSource.cs
deleted file mode 100644
index 2942271acc..0000000000
--- a/src/Umbraco.Infrastructure/PropertyEditors/MultiNodePickerConfigurationTreeSource.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Newtonsoft.Json;
-using Umbraco.Core;
-
-namespace Umbraco.Web.PropertyEditors
-{
- ///
- /// Represents the 'startNode' value for the
- ///
- [JsonObject]
- public class MultiNodePickerConfigurationTreeSource
- {
- [JsonProperty("type")]
- public string ObjectType {get;set;}
-
- [JsonProperty("query")]
- public string StartNodeQuery {get;set;}
-
- [JsonProperty("id")]
- public Udi StartNodeId {get;set;}
- }
-}
diff --git a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
index 5b104d2f9b..28c077a63c 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
@@ -250,7 +250,7 @@ namespace Umbraco.Web.BackOffice.Controllers
/// The culture to fetch the URL for
/// The URL or path to the item
[DetermineAmbiguousActionByPassingParameters]
- public HttpResponseMessage GetUrl(Udi udi, string culture = "*")
+ public IActionResult GetUrl(Udi udi, string culture = "*")
{
var intId = _entityService.GetId(udi);
if (!intId.Success)
@@ -284,7 +284,7 @@ namespace Umbraco.Web.BackOffice.Controllers
/// We are not restricting this with security because there is no sensitive data
///
[DetermineAmbiguousActionByPassingParameters]
- public HttpResponseMessage GetUrl(int id, UmbracoEntityTypes type, string culture = null)
+ public IActionResult GetUrl(int id, UmbracoEntityTypes type, string culture = null)
{
culture = culture ?? ClientCulture();
@@ -297,10 +297,7 @@ namespace Umbraco.Web.BackOffice.Controllers
{
returnUrl = foundUrl;
- return new HttpResponseMessage(HttpStatusCode.OK)
- {
- Content = new StringContent(returnUrl)
- };
+ return Ok(returnUrl);
}
}
@@ -314,10 +311,7 @@ namespace Umbraco.Web.BackOffice.Controllers
returnUrl = "/" + string.Join("/", ancestors.Select(x => x.Name));
- return new HttpResponseMessage(HttpStatusCode.OK)
- {
- Content = new StringContent(returnUrl)
- };
+ return Ok(returnUrl);
}
diff --git a/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs b/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs
index a878910bf3..d11b89f6f0 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/MacroRenderingController.cs
@@ -157,7 +157,7 @@ namespace Umbraco.Web.BackOffice.Controllers
}
[HttpPost]
- public HttpResponseMessage CreatePartialViewMacroWithFile(CreatePartialViewMacroWithFileModel model)
+ public IActionResult CreatePartialViewMacroWithFile(CreatePartialViewMacroWithFileModel model)
{
if (model == null) throw new ArgumentNullException("model");
if (string.IsNullOrWhiteSpace(model.Filename)) throw new ArgumentException("Filename cannot be null or whitespace", "model.Filename");
@@ -173,7 +173,7 @@ namespace Umbraco.Web.BackOffice.Controllers
};
_macroService.Save(macro); // may throw
- return new HttpResponseMessage(HttpStatusCode.OK);
+ return Ok();
}
public class CreatePartialViewMacroWithFileModel