MultiTool/MultiTool.Form/frmMapper.vb
Jonathan Jenne e732ce7099 WIP
2021-11-10 16:53:04 +01:00

36 lines
966 B
VB.net

Imports AutoMapper
Imports MultiTool.Shared
Public Class frmMapper
Public ExampleDict As New Dictionary(Of String, Object) From {
{"Laufnummer", "1"},
{"Rechnungsnummer", "4711"}
}
Public ExampleMapping As New Dictionary(Of String, String) From {
{"Laufnummer", "Text1"},
{"Rechnungsnummer", "Text2"}
}
Public Class ExampleObj
Public Property Text1 As String
Public Property Text2 As String
End Class
Private Sub frmMapper_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Dim oConfig As New MapperConfiguration(AddressOf GetConfig)
'Dim oMapper = oConfig.CreateMapper()
'Dim oObj = oMapper.Map(Of ExampleObj)(ExampleDict)
End Sub
'Private Sub GetConfig(c As IMapperConfigurationExpression)
' c.CreateMap(Of Dictionary(Of String, Object), ExampleObj)()
' c.AddProfile(New BlaProfile(ExampleMapping))
'End Sub
End Class