Timeline for Making a web service call based on a type of request
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 16, 2017 at 15:22 | comment | added | JanDotNet |
@Nazar554: Yes, that is another solution which uses a backing field internally, but i prefer the public string Name => "ReEnrol"; notation which just creates a property that returns the string.
|
|
Feb 16, 2017 at 15:14 | history | edited | JanDotNet | CC BY-SA 3.0 |
added 1 character in body
|
Feb 15, 2017 at 21:22 | vote | accept | Simsons | ||
Feb 15, 2017 at 17:25 | comment | added | Nazar554 |
In C# 6.0 you can also do public string Name { get; } = "ReEnrol";
|
|
Feb 15, 2017 at 16:17 | comment | added | Danko Durbić |
Instead of FirstOrDefault I would consider using SingleOrDefault because each implementation of IRequest should have a unique name. SingleOrDefault throws an exception if more than one element satisfies the condition.
|
|
Feb 15, 2017 at 13:36 | history | edited | JanDotNet | CC BY-SA 3.0 |
added feedback from peval27
|
Feb 15, 2017 at 13:16 | comment | added | peval27 | couple of nits: you're missing 'string' in the property Name, and it's requestHandlers is of type IRequest[] not IRequest | |
Feb 15, 2017 at 12:11 | history | edited | JanDotNet | CC BY-SA 3.0 |
added example
|
Feb 15, 2017 at 10:31 | history | answered | JanDotNet | CC BY-SA 3.0 |