次のように、MVC アクションで自動逆シリアル化を使用しようとしています。
public void CreateEntitlementEntity(EntitlementEntityModel model) {
// stuff
}
そして、これが私がデシリアライズしたいクラスです:
public class EntitlementEntityModel {
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public List<string> Domains { get; set; }
public EntitlementEntityModel() { }
}
データの JSON オブジェクトをコントローラー アクションに渡します。
data: {
FirstName: 'first',
LastName: 'last',
Email: 'email@email.com',
Domains: ['a','b','c']
}
文字列のリストを除いて、すべてのプロパティが正しく逆シリアル化されます。JSON 配列をリストに変換したいのですが、代わりに JSON 配列文字列という 1 つの文字列を含むリストが返されます。
.Net Framework 3.5 でこれを達成する方法はありますか?
ありがとう