我的代码如下。从List <EntityObject>转换为EntityObject
public void CreateNewAuthor(List<Author> newAuthor)
{
publishContext.AddToAuthors(newAuthor);
}
我知道这将导致错误的AddToAuthors(作者newAuthor)接受实体对象作为参数,而我传递一个List <>。那么应该如何处理?如何在AddToAuthors()之前将实体对象转换成列表<>?
列表是作为名称最高审计机关一个对象名单“。那么,您想如何将10位作者的列表转换为1位作者? –
也许你应该将你的变量重命名为'newAuthors' – Jodrell