정보 : VS2010, 나는 몇 가지 하위 요소를 추가 내 도메인 클래스 중 하나에 사용자 정의 생성자가 DSL 툴킷, C#을DSL 사용자 정의 생성자 - 전용 전화로드되지 만들 때
. 난 단지 이것이 당신이 일부 도메인 클래스의 속성을 초기화하는 것 같습니다
public Entity(Partition partition, params PropertyAssignment[] propertyAssignments)
: base(partition, propertyAssignments)
{
if (SOMETHING_TO_STOP_IT_RUNNING_EACH_TIME)
{
using (Transaction tx = Store.TransactionManager.BeginTransaction("Add Property"))
{
Property property = new Property(partition);
property.Name = "Class";
property.Type = "System.String";
this.Properties.Add(property);
this.Version = "1.0.0.0"; // TODO: Implement Correctly
tx.Commit();
}
}
}
감사합니다 Paul, 당신의 대답에 대해. 나는 지금 어떤 테스트를 할 것입니다! –
매우 효과적입니다. DSL에서 배워야 할 것이 많지만 노력이 필요하다는 것을 알고 있습니다. –
반 측면 질문. 다이어그램이 생성 될 때 (Project> Add Item) 생성자를 사용해야한다면 여기에서와 같은 패턴을 사용해야합니까? 감사 –