2013-09-25 5 views

답변

0

:

from a in Application.Assemblies 
where a.Name.StartsWith("YourCompany.YourProduct") 
select a 

아니면 더 정교한 뭔가를해야합니까?


좋아, 무엇 this default rule에서 영감을 얻기에 관하여 :

// <Name>UI layer shouldn't use directly DB types</Name> 
warnif count > 0 

// UI layer is made of types in namespaces using a UI framework 
let uiTypes = Application.Namespaces.UsingAny(Assemblies.WithNameIn("PresentationFramework", "System.Windows", "System.Windows.Forms", "System.Web")).ChildTypes() 

// You can easily customize this line to define what are DB types. 
let dbTypes = ThirdParty.Assemblies.WithNameIn("System.Data", "EntityFramework", "NHibernate").ChildTypes() 
       // Ideally even DataSet and associated, usage should be forbidden from UI layer: 
       // http://stackoverflow.com/questions/1708690/is-list-better-than-dataset-for-ui-layer-in-asp-net 
       .Except(ThirdParty.Types.WithNameIn("DataSet", "DataTable", "DataRow")) 

from uiType in uiTypes.UsingAny(dbTypes) 
let dbTypesUsed = dbTypes.Intersect(uiType.TypesUsed) 
select new { uiType, dbTypesUsed } 
물론

세트 uiTypesdbTypes은 수준 N + 1에서 레벨 N에서 어셈블리 및 어셈블리 정제해야합니다.

+0

우리는 100 개가 넘는 어셈블리를 보유하고 있으며 타이 용 규칙을 만들고 싶습니다. 따라서 N + 1 계층의 어셈블리는 N 계층 이하의 어셈블리에만 종속 될 수 있습니다. –

관련 문제