01 关于Conventions Caliburn.Micro的一个主要特性是,它能够通过一系列约定消除对锅炉铭牌代码的需求。有些人喜欢习俗,有些人讨厌习俗。 02 最后 原文标题:Caliburn.Micro Xaml made easy 原文链接:https://caliburnmicro.com/documentation/conventions 翻译:
一个典型的EF应用大多数情况下是一个DbContext的派生类(derived class)来控制,通常可以使用该派生类调用DbContext的构造函数,来控制以下的东西: (1)、上下文如何连接到数据库(给定连接字符串) (2)、上下文是通过Code First语法计算模型还是使用EF 设计器 (3)、额外的高级选项 下面是DbContext构造器的常用的用途: 一、DbContext无参构造函数 如果当前EF应用中没有做任何的配置.且在你自定义的数据库上下文类中没有调用DbContext带参的构造函数,
MyProject.MyViewModels.CustomerViewModel //MyProject.MyViews.CustomerPage -> MyProject.MyViewModels.CustomerViewModel //Change naming conventions MyProject.ViewModels.ViewModelCustomer //MyProject.Views.PageCustomer -> MyProject.ViewModels.ViewModelCustomer //Change naming conventions //Add support for "Form" as a synonym of "View" using the standard type and namespace naming conventions Views.MyApp.Some.Name.Space.TestView 最后 原文标题:Caliburn.Micro Xaml made easy 原文链接:https://caliburnmicro.com/documentation/custom-conventions
/applied-conventions: |- developer-conventions/live-update-convention developer-conventions /applied-conventions: developer-conventions/add-source-image-label developer.apps.tanzu.vmware.com /applied-conventions: |- spring-boot-convention/spring-boot labels: conventions.apps.tanzu.vmware.com Service intent conventions 不会改变最终部署的行为,但您可以将它们用作附加信息以在供应链中进行处理。 例如,当应用程序需要绑定到数据库服务时,此约定为每个检测到的依赖项添加注释和标签到 PodTemplateSpec,还向 conventions.apps.tanzu.vmware.com/applied-conventions
., 12 without the pernicious three dots, four conventions are open to us: (四种序列的标记方式) a) 2 ≤ i < The observation that conventions a) and b) have the advantage that the difference between the bounds language Mesa, developed at Xerox PARC, has special notations for intervals of integers in all four conventions Extensive experience with Mesa has shown that the use of the other three conventions has been a constant
具体来说,我们需要将注册的IApplicationModelConvention对象添加到MvcOptions如下所示的Conventions属性上。 class MvcOptions : IEnumerable<ICompatibilitySwitch> { public IList<IApplicationModelConvention> Conventions IApplicationModelProvider[] _providers; private readonly IList<IApplicationModelConvention> _conventions = options.Value.Conventions; } public ApplicationModel CreateApplicationModel(IEnumerable< , IReadOnlyList<object> attributes) { return Enumerable.Concat(conventions.OfType<TConvention
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
注意) There are many styles and when you use multiple libraries, you can't follow all their different conventions capitalize each word in a multi-word identifier: CamelCase:将多单词标识符中的每个字大写: int vector MyMap myMap Some conventions make up your mind Enforcement(实施建议) Would be possible except for the use of libraries with varying conventions
我们在上面说过,注册的约定路由规则最终体现为一个Action<EndpointBuilder>对象的列表,ConventionalRouteEntry的Conventions属性返回的就是这个列表。 = conventions; Pattern = RoutePatternFactory.Parse(pattern, defaults, constraints); } } ; public ControllerActionEndpointConventionBuilder(List<Action<EndpointBuilder>> conventions) { _conventions = conventions; } public void Add(Action<EndpointBuilder> convention) = > _conventions.Add(convention); } 我们最后来看看ControllerActionEndpointDataSource类型的定义。
Extended Random Notes 3.1 The C Integer Hierarchy 3.2 Endianness 3.3 Segmented Architectures 3.4 Calling Conventions 3.4.1 Problem and Motivation for Calling Conventions 3.4.2 Some Examples of Calling Conventions 感兴趣的读者可以浏览原文
ControllerActionDescriptor action) { _endpointFactory.AddEndpoints(endpoints, routeNames, action, _routes, conventions ActionEndpointDataSourceBase(IActionDescriptorCollectionProvider actions) { _actions = actions; Conventions Endpoint> CreateEndpoints(IReadOnlyList<ActionDescriptor> actions, IReadOnlyList<Action<EndpointBuilder>> conventions CreateEndpoints 中有一个 AddEndpoints 方法 _endpointFactory.AddEndpoints(endpoints, routeNames, action, _routes, conventions null, dataTokens: null, suppressLinkGeneration: false, suppressPathMatching: false, conventions
5、复杂类型约定(Complex Types Conventions) 如果Code First无法从类型中推测出主键,也没有通过Data Annotations或者Fluent Api进行注册的主键, string Location { get; set; } public string Num { get; set; } } 6、连接字符串约定(Connection String Conventions ) EF 数据库连接约定(Connection String Conventions in Code First) 二、移除约定 EF提供了移除默认约定的方法,通过该方法我们可以移除所有定义在System.Data.Entity.ModelConfiguration.Conventions modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); } } 三、自定义约定 EF 自定义约定
大纲 *Libraries* *Semantic Conventions* *Defining spans* *When not to instrument* *OpenTelemetry API* * Semantic Conventions 语义约定 Check out available semantic conventions that cover web-frameworks, RPC clients Semantic conventions are always evolving and new ones are constantly added. Follow the semantic conventions when setting span attributes. 设置Span属性时请遵循语义约定。 Refer to messaging conventions for details (WARNING: messaging conventions are under constructions).
By default, MVC follows certain conventions to determine which classes are considered to be controllers You can customize this behavior to suit your app's needs by creating your own conventions and applying 在Microsoft.AspNetCore.Mvc.MvcOptions中提供了Conventions属性: // // 摘要: // Gets public IList<IApplicationModelConvention> Conventions { get; } 通过操作它就能把自定义约定注入进去: services.AddMvc (options => { options.Conventions.Add(new ApiControllerAuthorizeConvention());
给出最小复现 + 修复方案## 依赖版本当前稳定版见 references/dependencies.md references/conventions.md 告诉 AI 「不要做 X」比「要做 Y」更有效 我的节奏是这样的: 每次 AI 犯了新错误,立刻补充进 conventions.md 的反模式清单。这是最频繁的更新,也是让 Skill 越来越好的核心机制。 引入新技术栈时,在 conventions.md 里加对应模板,在 SKILL.md 的 description 里追加触发词。 比如引入 Paging 3 后,description 加上"分页加载、Paging",正文加一条"Paging 详见 conventions.md"。 我第一次做这个审查,AI 发现了两个漏洞:description 里没有提到"Gradle 配置"导致写 build.gradle.kts 时无法触发;conventions.md 里有 Compose
} API版本约束 我们除了在方法和控制器上指定我们的版本,我们还可以采用另一种方式 services.AddApiVersioning( options => { options.Conventions.Controller services.AddApiVersioning( options => { options.Conventions.Controller<MyController>() options.Conventions.Add(new MyCustomConvention()); 当然我们还可以通过不同命名空间中的接口进行约束 options.Conventions.Add(new
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions /Conventions.html Method Names Should Be Expressive and Unique Within a Class Once you’ve chosen a unique
保留字符 依照 RFC 952 的保留名称 -GATEWAY -GW -TAC RFC 952 - DoD Internet host table specification Computer name conventions Active Directory user naming conventions MS-NBTE NetBIOS Name Syntax Active Directory 中计算机、域、站点和 OU
的目录结构很简洁: android-dev/ ├── SKILL.md # 核心:触发条件 + 使用说明 ├── references/ # 参考文档,按需加载 │ ├── conventions.md 代码生成时自动遵循 MVVM + Hilt + Compose 规范 分析 Crash 日志时能快速定位 Android 特有的根因 提供当前稳定的依赖版本,直接可用 第二步:设计文件结构 把知识分三类存放: conventions.md dependencies.md:libs.versions.toml 格式的最新稳定版依赖 这样设计的好处是"按需加载"——用户问 Crash 分析,AI 只读 crash_patterns.md;问代码规范,读 conventions.md --- 正文部分则列出核心能力索引和必须遵守的规范要点,把详细内容放到 references 文件里: ## 代码生成规范生成代码时遵循以下规范 (详见 references/conventions.md
CodeFirst.Entities; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.ModelConfiguration.Conventions DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Conventions.Remove <PluralizingTableNameConvention>(); } } } 这些规则都在“System.Data.Entity.ModelConfiguration.Conventions