コード例 #1
0
        public void KebabCaseStrategyEquality()
        {
            var s1 = new KebabCaseNamingStrategy();
            var s2 = new KebabCaseNamingStrategy();

            Assert.IsTrue(s1.Equals(s2));
            Assert.IsTrue(s1.GetHashCode() == s2.GetHashCode());
        }
コード例 #2
0
        protected override void SetJsonApiOptions(JsonApiOptions options)
        {
            base.SetJsonApiOptions(options);

            options.IncludeExceptionStackTraceInErrors = true;
            options.Namespace                 = "public-api";
            options.UseRelativeLinks          = true;
            options.IncludeTotalResourceCount = true;
            options.ValidateModelState        = true;

            var resolver = (DefaultContractResolver)options.SerializerSettings.ContractResolver;

            resolver !.NamingStrategy = new KebabCaseNamingStrategy();
        }