当前位置: 首页>>代码示例>>C#>>正文


C# ICodeBuilder.AddInterfaceAndReference方法代码示例

本文整理汇总了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);
        }
开发者ID:kmeze,项目名称:Rhetos,代码行数:15,代码来源:QueryableExtensionCodeGenerator.cs

示例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);
        }
开发者ID:koav,项目名称:Rhetos,代码行数:10,代码来源:ImplementsInterfaceCodeGenerator.cs

示例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));
            }
        }
开发者ID:koav,项目名称:Rhetos,代码行数:21,代码来源:OrmDataStructureCodeGenerator.cs

示例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);
        }
开发者ID:koav,项目名称:Rhetos,代码行数:12,代码来源:ComputedCodeGenerator.cs

示例5: GenerateCode

 public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
 {
     ImplementsInterfaceInfo info = (ImplementsInterfaceInfo)conceptInfo;
     codeBuilder.AddInterfaceAndReference(info.GetInterfaceType(), info.DataStructure);
 }
开发者ID:kmeze,项目名称:Rhetos,代码行数:5,代码来源:ImplementsInterfaceCodeGenerator.cs


注:本文中的ICodeBuilder.AddInterfaceAndReference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。