小编mk *_*hal的帖子

删除发送到Json MVC的对象的null属性

namespace Booking.Areas.Golfy.Models
{
    public class Time
    {
        public string   time            { get; set; }
        public int      holes           { get; set; }
        public int      slots_available { get; set; }
        public decimal? price           { get; set; }
        public int?     Nextcourseid    { get; set; }

        public bool ShouldSerializeNextcourseid
        {
            get
            {
                return this.Nextcourseid != null;
            }
        }

        public bool? allow_extra { get; set; }

        public bool ShouldSerializeallow_extra
        {
            get
            {
                return this.allow_extra != null;
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)


namespace Booking.Areas.Golfy.Controllers
{
    public class …
Run Code Online (Sandbox Code Playgroud)

c# serialization json asp.net-mvc-5

11
推荐指数
2
解决办法
1万
查看次数

替换 Azure 逻辑应用中的字符串

当我尝试替换 Azure 逻辑应用程序中的字符串值时,它抛出错误,表明您无法提供变量的自引用

"Set_variable": {
   "inputs": {
     "name": "Images",
     "value": "@replace(variables('Images'), 'cdn.gomasterkey.com/images/watermark.aspx?imageurl=/uf/', '~~')"
   },
   "runAfter": {
     "Append_to_array_variable": [
       "Succeeded"
     ]
   },
   "type": "SetVariable"
}
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

当我保存上面的代码时,我收到了这个错误,虽然我想从相同的变量中替换并再次放入它,但它不允许我提供自我引用。

c# azure azure-logic-apps

1
推荐指数
1
解决办法
3561
查看次数