1
I have the following method below for the purpose of returning notifications that must be displayed to a particular customer and notifications that must be displayed to all customers.
public List<TNotification> GetNotifications(TClient client)
{
var notificacoesClient = Session.CreateCriteria<TNotification>()
.CreateAlias("TClientNotifications", "clientNotifications", JoinType.LeftOuterJoin)
.SetFetchMode("clientNotifications.Client", FetchMode.Eager)
.CreateAlias("clientNotifications.Client", "client", JoinType.LeftOuterJoin)
.Add(Restrictions.Eq("client.Id", client.Id))
.AddOrder(Order.Desc("Id"))
.List<TNotification>()
.ToList();
var notificacoesAll = Session.CreateCriteria<TNotification>()
.Add(Restrictions.Eq("IsToAll", true))
.AddOrder(Order.Desc("Id"))
.List<TNotification>()
.ToList();
return notificacoesAll.Union(notificacoesClient);
}
But in education return notificacoesAll.Union(notificacoesClient);
is returning the following message:
Cannot implicity Convert type 'System.Collections.Generic.Ienumerable' to 'System.Collections.Generic.List'. An Explicit Conversion exists (are you Missing a cast?)
How could I resolve this issue?
follow these rules to creation or editing of questions and answers +1 for the answer.
– novic