cost 306 ms
'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' 上的 System.DateTime 使用 AutoMapper 11.0.1 違反了 .NET 7 類型 T 的約束

[英]System.DateTime on 'T MaxInteger[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type T for .NET 7 using AutoMapper 11.0.1

完整的來源;// See https://aka.ms/new-console-template for more information using AutoMapper; Console.WriteLine("Hello, World!"); var mapperConfig = new M ...

在 ASP.NET 核心 Web ZDB974238714CA8DE634A7CE1D0FZA8 的 class 庫項目中使用 AutoMapper

[英]Use AutoMapper inside a class library project in ASP.NET Core Web API

我收到此錯誤: AutoMapper.AutoMapperMappingException:“缺少類型 map 配置或不支持的映射。” 在我的項目中嘗試將 map 和 EF model 連接到我的 DTO 時。 配置文件和值解析器位於我的 class 庫項目中。 這是我的個人資料課程之一: 這是 ...

使用自動映射器未扁平化

[英]Unflatted with automapper

假設我有一個具有以下三個屬性的 EF Core model:public int Id { get; set; } public string? ApplicationName { get; set; } public string? ApplicationVersion { get; set; } ...

Automapper 的項目與 generics 玩得不好

[英]Automapper's ProjectTo not playing nice with generics

將ProjectTo與 automapper 和 generics 一起使用似乎效果不佳。 我創建了這個映射:CreateMap<ChecklistSoftwareFirmware, OutputDTO>() .AfterMap((entity, dto) => { ...

In.Net Core 6 Api,如何 map 只有存在於 DTO uisng AutoMapper 11 中的值?

[英]In .Net Core 6 Api, how to map only the values that exist in the DTO uisng AutoMapper 11?

在使用 .NET Core 6(這是我的第一個 Api)編寫 Api 時,我在編寫更新方法時遇到了一些麻煩。 我需要更新下面的應用程序表 但只有狀態應該改變,rest 必須保持不變。 為此,我寫了一個如下所示的 DTO, 我的 HttpPut 方法是 在這種情況下,請求只有 ID 和狀態這 2 個 ...

ProjectTo 與 ITypeConverter

[英]ProjectTo with ITypeConverter

我正在使用 Automapper 通過ProjectTo<>()將數據庫實體從實體框架映射到業務對象。 現在我想將可空的十進制映射/投影到 class 類型,並且不想為每個 object 中的每個屬性指定這兩種類型的手動映射,所以我決定使用自定義類型轉換器,Automapper 將完成 ...

帶有子列表實體的 model 中的 AutoMapper ProjectTo

[英]AutoMapper ProjectTo from a model with child list entity

這在 AutoMapper 中可能嗎? Select X 類型的列表和 Y 類型的過濾器子實體(返回 Y 的單個值) ProjectTo 到平面 DTO 包含來自 X 和 Y 的道具。 如果不是,那么在這種情況下填充 DTO 的最佳方法是什么,這些表只是例如,在實際情況下,表有很多列,我想避免 ...

AutoMapper 11. 缺少 API 替換

[英]AutoMapper 11. Missing API replacements

28.2 ForAllMaps、ForAllPropertyMaps、Advanced 和其他“缺失”的 API 一些 API 被隱藏以供正常使用。 要點亮它們,您需要為 AutoMapper 添加一個 using。 內部並在配置 object 上調用內部擴展方法。 大多數用戶不需要這些高級方法。 ...

如何修復:具有沖突依賴性的 Automapper 11

[英]How to fix: Automapper 11 with conflict dependency

將 Autommaper 從 10 升級到最新的 v.11 並將 Automapper.Collection 升級到最新的 v.7 后,似乎存在沖突。 是設計使然嗎? 我應該擔心它可能會在未來引起問題嗎? 如何解決? ...

Automapper 和 Nullable Reference Type 提出“需要有一個帶有 0 個 args 或只有可選 args 的構造函數”

[英]Automapper and Nullable Reference Type raise "needs to have a constructor with 0 args or only optional args"

設想我不能 map class enabled string和可為空的引用類型 解決方法我找到了兩個解決方法: 一如果我在 CreateMap 上指定.ForCtorParam("author", o => o.MapFrom(k => "dummy"))它工作正常 二添加一個 arg ...

AutoMapper 11 映射 ReadOnlyCollection 屬性的行為

[英]AutoMapper 11 behaviors of mapping ReadOnlyCollection property

我是 AutoMapper 的新手,我想在他們的 github 上發布這個問題,但考慮到他們的問題模板: If you're new to AutoMapper, please ask a question on StackOverflow first and come back here if t ...


排序:
質量:
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM