I have a set of objects to which I would just like to add a new property. How to do this with LINQ?
var a = from i in ObjectCollection select new {i.prop1, i.prop2, i.prop3, ..., newprop = newProperty}
I do not think you can use pure LINQ. However, if you do so much in your code, you can do this work with reflection.
Why do you want to add additional property? Or, in other words, what are you going to do with this property when it is in your new IEnumerable source?
If you need it for data binding, I have a helper class that can help you.
Source: https://habr.com/ru/post/1696699/More articles:Существуют ли соглашения для имен функций при использовании Perl Test:: More? - perlfprintf returns success but cannot write an existing file - cHow can I convince GroovyShell to maintain state over eval () calls? - javaManaging / using libraries with builds Debug vs Release builds - release-buildsA service for creating an audio podcast from a video? - videoWhat tool do I use if I want to visually display the programming structure and see the relationship between all objects? - mappingLink to embedded resources from other resources in C # - javascriptAny way to handle Put and Delete verbs in ASP.Net MVC? - restHow to manage web application by email? Or how to run a PHP script by sending an email? - cakephpWhat languages support covariance on return types of inherited methods? - javaAll Articles