I'm new to trying Mapster with EF6 and for select queries it has been great. I'm trying it out with updates and this seems like it should be pretty straightforward. I was hoping to be able to update my root entity fields without re-mapping the child collection which caused unnecessary inserts. I installed Mapster.EF6 2.0.0, followed the examples on the Wiki page.
For clarity I removed .AdaptTo(userEntity) because it wasn't getting there.
Throws the exception:
System.InvalidOperationException
Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at Mapster.TypeAdapterBuilderExtensions.<>c__DisplayClass0_0`1.<EntityFromContext>b__0(TypeAdapterConfig config)
at Mapster.TypeAdapterConfig.<>c__DisplayClass99_0.<Fork>b__0(String _)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Mapster.TypeAdapterConfig.Fork(Action`1 action, String key1, Int32 key2)
at Mapster.TypeAdapterBuilder`1.ForkConfig(Action`1 action, String key1, Int32 key2)
at <snip>Repositories.UserRepository.SaveUpdateUser(Int32 updatingUserId, User userToSave) in <snip> Repositories\UserRepository.cs:line 198
<snip> at UnitTests.Repositories.UserRepositoryTest.UpdateUserDetails() in <snip>\Repositories\UserRepositoryTest.cs:line 364
Hi,
I'm new to trying Mapster with EF6 and for select queries it has been great. I'm trying it out with updates and this seems like it should be pretty straightforward. I was hoping to be able to update my root entity fields without re-mapping the child collection which caused unnecessary inserts. I installed Mapster.EF6 2.0.0, followed the examples on the Wiki page.
For clarity I removed
.AdaptTo(userEntity)
because it wasn't getting there.Throws the exception:
Would appreciate any suggestions.
Thanks, Kerry