本文整理汇总了C#中ICodeBuilder.AddInterfaceAndReference方法的典型用法代码示例。如果您正苦于以下问题:C# ICodeBuilder.AddInterfaceAndReference方法的具体用法?C# ICodeBuilder.AddInterfaceAndReference怎么用?C# ICodeBuilder.AddInterfaceAndReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICodeBuilder
的用法示例。
在下文中一共展示了ICodeBuilder.AddInterfaceAndReference方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
var info = (QueryableExtensionInfo)conceptInfo;
codeBuilder.InsertCode(CodeSnippet(info), DataStructureCodeGenerator.BodyTag, info);
codeBuilder.AddInterfaceAndReference(string.Format("System.IEquatable<{0}>", info.Name), typeof(IEquatable<>), info);
PropertyInfo idProperty = new PropertyInfo { DataStructure = info, Name = "ID" };
PropertyHelper.GenerateCodeForType(idProperty, codeBuilder, "Guid", true);
codeBuilder.AddInterfaceAndReference(typeof(IEntity), info);
RepositoryHelper.GenerateRepository(info, codeBuilder);
RepositoryHelper.GenerateQueryableRepositoryFunctions(info, codeBuilder, QuerySnippet(info));
codeBuilder.InsertCode(RepositoryFunctionsSnippet(info), RepositoryHelper.RepositoryMembers, info);
}
示例2: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
ImplementsInterfaceInfo info = (ImplementsInterfaceInfo)conceptInfo;
Type type = Type.GetType(info.InterfaceType);
if (type == null)
throw new FrameworkException("Could not find type \"" + info.InterfaceType + "\"");
codeBuilder.AddInterfaceAndReference(type, info.DataStructure);
}
示例3: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
var info = (DataStructureInfo)conceptInfo;
if (info is IOrmDataStructure)
{
codeBuilder.InsertCode(CodeSnippet(info), DataStructureCodeGenerator.BodyTag, info);
codeBuilder.AddInterfaceAndReference(string.Format("System.IEquatable<{0}>", info.Name), typeof (System.IEquatable<>), info);
PropertyInfo idProperty = new PropertyInfo {DataStructure = info, Name = "ID"};
PropertyHelper.GenerateCodeForType(idProperty, codeBuilder, "Guid", true);
codeBuilder.AddInterfaceAndReference(typeof (IEntity), info);
RepositoryHelper.GenerateRepository(info, codeBuilder);
RepositoryHelper.GenerateQueryableRepositoryFunctions(info, codeBuilder, QuerySnippet(info));
codeBuilder.AddReferencesFromDependency(typeof(IQueryDataSourceCommandImplementation));
codeBuilder.AddReferencesFromDependency(typeof(GenericFilterWithPagingUtility));
codeBuilder.AddReferencesFromDependency(typeof(QueryDataSourceCommandResult));
}
}
示例4: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
var info = (ComputedInfo)conceptInfo;
PropertyInfo idProperty = new PropertyInfo { DataStructure = info, Name = "ID" };
PropertyHelper.GenerateCodeForType(idProperty, codeBuilder, "Guid", true);
codeBuilder.AddInterfaceAndReference(typeof(IEntity), info);
RepositoryHelper.GenerateRepository(info, codeBuilder);
RepositoryHelper.GenerateQueryableRepositoryFunctions(info, codeBuilder, QueryFunctionBodySnippet(info));
codeBuilder.InsertCode(RepositoryFunctionsSnippet(info), RepositoryHelper.RepositoryMembers, info);
}
示例5: GenerateCode
public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
{
ImplementsInterfaceInfo info = (ImplementsInterfaceInfo)conceptInfo;
codeBuilder.AddInterfaceAndReference(info.GetInterfaceType(), info.DataStructure);
}