Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Xamarin与Kinvey数据库_C#_Xamarin_Kinvey - Fatal编程技术网

C# Xamarin与Kinvey数据库

C# Xamarin与Kinvey数据库,c#,xamarin,kinvey,C#,Xamarin,Kinvey,我正在使用Kinvey db进行我与Xamarin的项目。我熟悉解析指针功能。我想用Kinvey做同样的功能。Kinvey也有参考功能。我试过了,但它总是将空值存储在古怪的db中。所以我真的被困在这上面了。 这是我在Kinvey中的最终结果,它存储空值 结果: {“类型”:“KinveyRef”、“\u id”:“55f18c9d39d29b9e0f023748”、“\u集合”:“颜色”、“\u对象”:null} 我的数据库模型类 [JsonObject(MemberSerialization.

我正在使用Kinvey db进行我与Xamarin的项目。我熟悉解析指针功能。我想用Kinvey做同样的功能。Kinvey也有参考功能。我试过了,但它总是将空值存储在古怪的db中。所以我真的被困在这上面了。 这是我在Kinvey中的最终结果,它存储空值

结果:
{“类型”:“KinveyRef”、“\u id”:“55f18c9d39d29b9e0f023748”、“\u集合”:“颜色”、“\u对象”:null}

我的数据库模型类

[JsonObject(MemberSerialization.OptIn)]
public class Gallery
{
    public Gallery ()
    {
    }

    [JsonProperty("_id")]
    public string ID { get; set; }

    [JsonProperty]
    public string Name { get; set; }

    [JsonProperty]
    public KinveyReference<Color> color;
}


[JsonObject(MemberSerialization.OptIn)]
public class Color
{ 
    public Color ()
    {
    }

    [JsonProperty("_id")]
    public string ID { get; set; }

    [JsonProperty]
    public string Title { get; set; }

    [JsonProperty]
    public string Code { get; set; }

}
[JsonObject(MemberSerialization.OptIn)]
公共教室
{
公众席()
{
}
[JsonProperty(“\u id”)]
公共字符串ID{get;set;}
[JsonProperty]
公共字符串名称{get;set;}
[JsonProperty]
公共KinveyReference颜色;
}
[JsonObject(MemberSerialization.OptIn)]
公共类颜色
{ 
公共颜色()
{
}
[JsonProperty(“\u id”)]
公共字符串ID{get;set;}
[JsonProperty]
公共字符串标题{get;set;}
[JsonProperty]
公共字符串代码{get;set;}
}
在数据库中存储数据的代码为

 AsyncAppData<Gallery> entityCollection = Client.AppData<User>("Gallery", typeof(Gallery));
            entityCollection.setCache(cache, CachePolicy.CACHE_FIRST);

            AsyncAppData<Color> colorCollection = Client.AppData<Color>("Color", typeof(Color));
            colorCollection.setCache(lcache, CachePolicy.CACHE_FIRST);

            Color color = new Color();
            color.Title = "Pink";
            color.Code = "ff00ff";

            Color colorEnt  = await colorCollection.SaveAsync(color);

            Gallery gallery = new Gallery();
            gallery.Name = "HARSHAD";
            gallery.ID = "1211222as";
            KinveyReference<Color> reference = new KinveyReference<Color>("Color",colorEnt.ID); 
            gallery.color = reference;

            Gallery entity = await entityCollection.SaveAsync(gallery);
AsyncAppData entityCollection=Client.AppData(“Gallery”,typeof(Gallery));
setCache(cache,CachePolicy.cache_优先);
AsyncAppData colorCollection=Client.AppData(“Color”,typeof(Color));
setCache(lcache,CachePolicy.CACHE_FIRST);
颜色=新颜色();
color.Title=“粉红色”;
color.Code=“ff00ff”;
Color colorEnt=await colorCollection.SaveAsync(Color);
画廊=新画廊();
gallery.Name=“HARSHAD”;
gallery.ID=“1211222as”;
KinveyReference引用=新的KinveyReference(“Color”,colorEnt.ID);
gallery.color=参考;
Gallery entity=await entityCollection.SaveAsync(Gallery);

如果需要更详细的信息,请告诉我。

我不知道Kinvey的情况。我与Parse合作过。你看过医生了吗?可能他们已经提到了。我已经参考了这个链接:@SagarPanwala。在参考了链接和文档后,我会让你知道的。嘿,你能展示一下
loo
use
的定义吗?这是正在保存的两个实体,但它们的定义没有发布。@edthethird:我编辑了它。