locked
No mapping exists from object type system.collections.generic.list`1 to a known managed provider native type RRS feed

  • Question

  • I have passed ids list as parameter to Store procedure but when cal storeprocedure got the error

    No mapping exists from object type System.Collections.Generic.List`1[[System.Nullable`1[[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] to a known managed provider native type "

    var idsparam=new sqlparameter
    {
      parameterName="Ids",
      value=request.ids
    }
    var _addressSetiingspredicate=_dbcontext.database.SqlQuery<BaseNewBusinessAdressSettingModel>(@"Exec SP_AdressSettings @Ids",idsparam).ToList<BaseNewBusinessAdressSettingModel>

    Please help me.

    Thanks

    Thursday, September 24, 2020 7:06 AM

All replies

  • Hi rammi P,
    I have provided a solution in your other thread.
    The solution is that passing each parameter to the method instead of pass a "sqlparameter" list.
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 25, 2020 2:18 AM
  • Hi rammi P,
    Has your problem been solved? If it is resolved, we suggest that you mark it as the answer. So it can help other people who have the same problem find a solution quickly. If not solved, what problem did you encounter?
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 30, 2020 8:41 AM