2017-04-04 4 views
0

私はAzure Mobile Serviceを持っています。これは、1つのテーブルからデータを取り出しています。Azure Mobileサービスでデータ型のコンポジットプライマリキーの順序を決定できません。DataObject

モデルクラスで

私は[Key]Primary Keyため.Thereは一つだけPKテーブルwp_postsためである定義されているが、私はエラーを取得しています -

タイプのために複合主キーの順序を決定することができません

私はテーブルwp_postsに関して正しいcomposite keyを定義する必要があります誰も方法を見つけることができますか?

​​

[Table("wp_posts")] 
public class wp_posts: EntityData 
{ 
    [Key] 
    [Column("ID")] 
    public int ID { get; set; }  
    public int post_author { get; set; }  
    public DateTime post_date { get; set; }  
    public DateTime post_date_gmt { get; set; }  
    public string post_content { get; set; }  
    public string post_title { get; set; } 
    public string post_excerpt { get; set; } 
    public string post_status { get; set; }  
    public string comment_status { get; set; } 
    public string ping_status { get; set; }  
    public string post_password { get; set; }  
    public string post_name { get; set; }  
    public string to_ping { get; set; } 
    public string pinged { get; set; } 
    public DateTime post_modified { get; set; }  
    public DateTime post_modified_gmt { get; set; } 
    public string post_content_filtered { get; set; }  
    public int post_parent { get; set; } 
    public string guid { get; set; } 
    public int menu_order { get; set; } 
    public string post_type { get; set; }  
    public string post_mime_type { get; set; }  
    public int comment_count { get; set; } 
} 

表Strucutreは、MySQLデータベースのワードプレス。

Table: wp_posts 
    Field Type Null Key Default Extra 
    ID bigint(20) unsigned  PRI & IND Pt4  auto_increment 
    post_author bigint(20) unsigned  IND 0  
    post_date datetime  IND Pt3 0000-00-00 00:00:00 
    post_date_gmt datetime   0000-00-00 00:00:00 
    post_content longtext     
    post_title text     
    post_excerpt text     
    post_status varchar(20)  IND PT2 publish 
    comment_status varchar(20)   open  
    ping_status varchar(20)   open  
    post_password varchar(20)    
    post_name varchar(200)  IND  
    to_ping text     
    pinged text     
    post_modified datetime   0000-00-00 00:00:00 
    post_modified_gmt datetime   0000-00-00 00:00:00 
    post_content_filtered longtext     
    post_parent bigint(20) unsigned  IND 0  
    guid varchar(255)     
    menu_order int(11)   0  
    post_type varchar(20)  IND Pt1 post  
    post_mime_type varchar(100)     
    comment_count bigint(20)   0  
    Indexes 

    Keyname Type Field 
    PRIMARY PRIMARY ID 
    post_name INDEX post_name 
    type_status_date INDEX post_type 
    post_status 
    post_date 
    ID 
    post_parent INDEX post_parent 
    post_author INDEX post_author 

答えて

1

Azure Mobile Appsは、オフラインでの同期に使用できるように、テーブルに対してかなり厳しい要件があります。詳細は、第3章http://aka.ms/zumobookを参照してください。

この表は、これらの要件を満たしていません。具体的には、IDは文字列ではなく、updatedAtまたはversionフィールドはありません。ソフト削除(モバイルアプリで行う必要がある)の場合は、削除されたフィールドも必要です。

EntityData classをご覧ください。あなたのIDフィールドは既に定義されており、あなたの代替定義です。

+0

与えられた詳細リンクと説明に感謝します:)それが好きでした。 – Neo

関連する問題