DevExpress--XPO映射数据库多列主键情景

using System;  
using DevExpress.Xpo;  
using System.ComponentModel;  

public struct SalesKey {  
    [Persistent("stor_id")]  
    public string StorId {get; set;}  
    [Persistent("ord_num")]  
    public string OrdNum {get; set;}  
    [Persistent("title_id")]  
    public string TitleId {get; set;}  
}  

[Persistent("sales"), OptimisticLocking(false)]  
public class Sales : XPBaseObject {  
    [Key, Persistent, Browsable(false)]  
    public SalesKey Key {get; set;}  

    [Persistent("payterms")]  
    public string PayTerms {...}  
    ... // other properties  
}  

参考:https://supportcenter.devexpress.com/ticket/details/a2615/xpo-how-to-map-persistent-objects-to-database-tables-with-compound-or-composite-multi#

(完)

posted @ 2021-09-26 17:50  lishidefengchen  阅读(58)  评论(0编辑  收藏  举报