2011-09-15 4 views
0

웹 응용 프로그램에 WCF 데이터 서비스가 있습니다. 내 Silverlight 응용 프로그램에서 "Add New Service Reference"명령을 사용하여 서비스 참조를 추가했습니다. 내가 VS Reference.cs 파일을 찾고 있었는데 나를 위해 생성자와 OnPropertyChanged를 호출하기 전에 설정을 확인하지 않는 것으로 나타났습니다. 이 동작을 변경하고 싶습니다. 모든 코드 생성을 무시하지 않고도 T4 템플릿을 재정의 할 수 있습니까? 가능하면 어떻게해야할까요?Silverlight WCF Data Service ServiceReference의 T4를 변경할 수 있습니까?

/// <summary> 
    /// There are no comments for Property Title in the schema. 
    /// </summary> 
     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] 
    public string Title 
    { 
    get 
    { 
     return this._Title; 
    } 
    set 
    { 
     // change to 
     if(this._Title != value) { 
      this.OnTitleChanging(value); 
      this._Title = value; 
      this.OnTitleChanged(); 
      this.OnPropertyChanged("Title"); 
     } 
     } 
    } 

답변

1

불행하게도 WCF 데이터 서비스에 대한 추가 서비스 참조 아직 T4를 사용하지 않습니다

원래 코드

/// <summary> 
/// There are no comments for Property Title in the schema. 
/// </summary> 
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")] 
public string Title 
{ 
    get 
    { 
     return this._Title; 
    } 
    set 
    { 
     this.OnTitleChanging(value); 
     this._Title = value; 
     this.OnTitleChanged(); 
     this.OnPropertyChanged("Title"); 
    } 
} 

원하는 변화를 생성합니다. 이렇게 쉬운 방법이 없습니다. 이 기능에 대해 투표하려면 여기로 자유롭게하십시오 : http://blogs.msdn.com/b/astoriateam/archive/2010/09/10/what-do-you-want-to-see-added-changed-in-wcf-data-services.aspx

+0

감사합니다. 내 표를 추가했습니다. – Aligned

관련 문제