2010-09-16 74 views
3

我有一個模型對象調用Country命名DTO對象

class Country 
{ 
    public string Name { get; set; } 
    public string Code { get; set; } 
    public Region[] Regions {get;set;} 
    public URI[] Uris {get;set;} 
} 

,並通過WebService的我想在幾個版本得到這個國家:

  1. 只有名稱和代碼
  2. 每場
  3. 沒有尤里斯
  4. 每場每一個申請沒有地區
  5. 的集合

什麼名字給他們呢?

  1. CountryNameWithCode
  2. CountryWithoutUris
  3. 國家
  4. CountryWithoutRegions?

這是在英國的客戶。對不起,我英文很差。

回答

1

這裏是我的選擇:

  1. CountryId/CountryIdentity/CountryRef/CountryEntry
  2. 國家/ CountryDetails/CountyAllInfo
  3. CountryWithRegions
  4. CountryWithUris
2

這是命名方法返回Country對象,並減少數據的trasferred量?

怎麼樣:國家(bool includeRegions,bool includeURIs)

+0

看起來不錯,但是如果我的班級有例如10個字段?它不會看起來很好 – user278618 2010-09-18 18:04:31