How to automap this(mapping sub members)

前端 未结 4 1963
春和景丽
春和景丽 2021-01-17 13:52

I have something like this

public class ProductViewModel
{
  public int SelectedProductId { get; set; }
  public string ProductName {get; set;}
  public int          


        
4条回答
  •  攒了一身酷
    2021-01-17 14:11

    The error your getting is because you cannot declare mapping declarations more than one level deep in your object graph.

    Because you've only posted one property its hard for me to give you the codes that will make this work. One option is to change your viewmodel property to MyTestTestId and the conventions will automatically pick up on that.

提交回复
热议问题