【问题标题】:Breezejs .net core 3 saving new entities issueBreezejs .net core 3 保存新实体问题
【发布时间】:2020-02-05 22:22:50
【问题描述】:

为 .net core 3.1 使用 BreezeJs 保存新实体时出现 fixupKeys 问题 抛出“无法找到以下完全限定的 EntityType 名称:”

检查一下:_entityGroupMap 条目使用另一种完全限定的格式,而不是 keymappings 对象 例如 HoseColor:#Urflex.Webshop.Model (_entityGroupMap) > Urflex.Webshop.Model.HoseColor (keymappings)

如何解决?

【问题讨论】:

    标签: breeze ef-core-3.1


    【解决方案1】:

    问题解决了。忽略了 web api 项目的 startup.cs 文件中的一些配置。 正如微风文档所述:

    var mvcBuilder = services.AddMvc();
      services.AddControllers().AddNewtonsoftJson(opt =>
            {
                // Set Breeze defaults for entity serialization
                var ss = JsonSerializationFns.UpdateWithDefaults(opt.SerializerSettings);
                if (ss.ContractResolver is DefaultContractResolver resolver)
                {
                    resolver.NamingStrategy = null;  // remove json camelCasing; names are converted on the client.
                }
                ss.Formatting = Newtonsoft.Json.Formatting.Indented; // format JSON for debugging
            });
    
            // Add Breeze exception filter to send errors back to the client
            mvcBuilder.AddMvcOptions(o => { o.Filters.Add(new GlobalExceptionFilter()); });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-06
      • 1970-01-01
      相关资源
      最近更新 更多