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.iqueryable
1[system.string], system.linq.expressions.expression
1[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
Post a Comment