Error Array of bool to Option<Array of bool>

22 views
Skip to first unread message

Aliaksandr Shustouski

unread,
Feb 9, 2024, 11:06:24 AMFeb 9
to AutoMapper-users
I have this error:

Unknown collection. Consider a custom type converter from System.Boolean[] to LanguageExt.Option`1[System.Boolean[]]

class A {
public string Value {get;set;}
}

record B (Option<bool[]> Value)

CreateMap<A, B>()
.ForCtorParam(
    nameof(B.Value ),
    opt => opt.MapFrom(src => ParseStringToArray()))

bool[]? ParseStringToArray() {
return null;
}

Work just if
record B (Option<IReadOnlyCollection<int>> Value) 

How can help?

Thanks

Aliaksandr Shustouski

unread,
Feb 9, 2024, 11:09:00 AMFeb 9
to AutoMapper-users
If record B (Option<IReadOnlyCollection<bool>> Value) 
the error is
Unknown collection. Consider a custom type converter from System.Collections.Generic.IReadOnlyCollection`1[System.Boolean] to LanguageExt.Option`1[System.Collections.Generic.IReadOnlyCollection`1[System.Boolean]].

пятница, 9 февраля 2024 г. в 18:06:24 UTC+2, Aliaksandr Shustouski:
Reply all
Reply to author
Forward
0 new messages