0

如何将实体集合设置为空?我尝试过这样的事情

user.movies = new List<movie>();

但我收到此错误:

Cannot implicitly convert type 'System.Collections.Generic.List<MvcApplication2.dal.movie>' to 'System.Data.Objects.DataClasses.EntityCollection<MvcApplication2.dal.movie>'
4

1 回答 1

5

user.movies.Clear();或者user.movies = null;

于 2013-02-14T00:11:27.060 回答