Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
AnswerRe: read blob from database Pin
Eddy Vluggen18-May-16 23:11
professionalEddy Vluggen18-May-16 23:11 
AnswerRe: read blob from database Pin
Member 120300006-Jul-16 14:58
Member 120300006-Jul-16 14:58 
QuestionProblems Related to E commerce APIs Pin
anokeha_prani17-May-16 20:51
anokeha_prani17-May-16 20:51 
AnswerRe: Problems Related to E commerce APIs Pin
Dave Kreskowiak18-May-16 2:17
mveDave Kreskowiak18-May-16 2:17 
QuestionDynamically Insert A Property Into A LINQ Query Statement Pin
MadDashCoder17-May-16 9:56
MadDashCoder17-May-16 9:56 
AnswerRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
Sascha Lefèvre17-May-16 10:32
professionalSascha Lefèvre17-May-16 10:32 
GeneralRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
MadDashCoder17-May-16 10:34
MadDashCoder17-May-16 10:34 
GeneralRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
Sascha Lefèvre17-May-16 11:06
professionalSascha Lefèvre17-May-16 11:06 
MadDashCoder wrote:
In my test project my code does return a Toy object.
Then the value in the setter would also be of type Toy. The only half sensible types to use would be object or string.

MadDashCoder wrote:
This is just a test project to find out how I can use a single set property to change different properties using one LINQ Query.
It's always going to be messy and I would avoid it unless there's some very compelling reason to do so.

Staying with your pseudo-code-style, it should look like this:
C#
public object this[int toyId, string toyProperty]
{
  get { return listOfProducts.Single(prod => prod.Id == toyId).toyProperty; }
  set { listOfProducts.Single(prod => prod.Id == toyId).toyProperty = value; }
}
And to resolve the .toyProperty pseudo-code you would have to use reflection or reflection+expressions.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson


modified 17-May-16 17:18pm.

AnswerRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
Dave Kreskowiak17-May-16 11:17
mveDave Kreskowiak17-May-16 11:17 
AnswerRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
Matt T Heffron17-May-16 12:22
professionalMatt T Heffron17-May-16 12:22 
GeneralRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
MadDashCoder17-May-16 13:11
MadDashCoder17-May-16 13:11 
GeneralRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
Matt T Heffron17-May-16 14:51
professionalMatt T Heffron17-May-16 14:51 
AnswerRe: Dynamically Insert A Property Into A LINQ Query Statement Pin
Gerry Schmitz19-May-16 6:41
mveGerry Schmitz19-May-16 6:41 
QuestionHow record behavior of a process in windows? Pin
saeedmir17-May-16 7:26
saeedmir17-May-16 7:26 
AnswerRe: How record behavior of a process in windows? Pin
BillWoodruff17-May-16 7:46
professionalBillWoodruff17-May-16 7:46 
GeneralRe: How record behavior of a process in windows? Pin
saeedmir17-May-16 7:52
saeedmir17-May-16 7:52 
GeneralRe: How record behavior of a process in windows? Pin
Eddy Vluggen17-May-16 8:03
professionalEddy Vluggen17-May-16 8:03 
Rant[REPOST] How record behavior of a process in windows? Pin
Richard Deeming17-May-16 7:49
mveRichard Deeming17-May-16 7:49 
QuestionObject is currently in use elsewhere C# - System.Drawing Exception Pin
Django_Untaken16-May-16 21:56
Django_Untaken16-May-16 21:56 
AnswerRe: Object is currently in use elsewhere C# - System.Drawing Exception Pin
Pete O'Hanlon16-May-16 23:09
mvePete O'Hanlon16-May-16 23:09 
Question[Updated] AnyCPU and exposing functionality via COM Pin
Matt T Heffron16-May-16 13:51
professionalMatt T Heffron16-May-16 13:51 
AnswerRe: AnyCPU and exposing functionality via COM Pin
Garth J Lancaster16-May-16 16:28
professionalGarth J Lancaster16-May-16 16:28 
GeneralRe: AnyCPU and exposing functionality via COM Pin
Matt T Heffron17-May-16 7:20
professionalMatt T Heffron17-May-16 7:20 
Questionsearch quickly Pin
Denis Tarasov16-May-16 13:26
Denis Tarasov16-May-16 13:26 
AnswerRe: search quickly Pin
OriginalGriff16-May-16 19:27
mveOriginalGriff16-May-16 19:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.