Cannot initialize type '' with a collection initializer because it does not implement 'System.Collections.IEnumerable'

后端 未结 2 596
终归单人心
终归单人心 2020-12-30 18:47

I have created a class which holds three classes as properties:

public class Feeds
{
    public Rentals Rentals { get; set; }
    public Agent Agents { get;          


        
2条回答
  •  囚心锁ツ
    2020-12-30 19:24

    Should be:

    var query = from r in ent.Rentals
               join a in ent.Agents on r.ListingAgentID equals a.AgentID
               select new Feeds
               {
                        Agents = a,
                        Rentals = r
               }
    

提交回复
热议问题