c# - How to combine this String with LINQ -


i have linq query. has combine matching string " " single string value. tried below code model. showing:

linq entities not recognize method 'system.string aggregate[string](system.linq.iqueryable1[system.string], system.linq.expressions.expression1[system.func`3[system.string,system.string,system.string]])' method, , method cannot translated store expression.

please suggest me how can write query combine set of strings single string.

code

btags = db.bibcontents.where(x => x.bibid == q.bibid && x.tagno == "245")         .select(x => x.normvalue)         .aggregate((s, x) => s + " " + x).firstordefault() 

thanks

why not use string.join like:

string str = string.join(" ", db.bibcontents                                .where(x => x.bibid == q.bibid && x.tagno == "245")                                .select(x => x.normvalue)); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -