Jothay
Jothay
CC#
Created by Fjärilsmannen on 6/23/2023 in #help
How do you get the output type from a powershell script with System.Management.Automation?
For common stuff like that, you could switch case the type values and handle string, int, etc individually
21 replies
CC#
Created by spicedruid on 6/23/2023 in #help
❔ Make interface deriving from another interface have a sealed implementation of a function
The learn page that is linked at the end of the article shows a pattern to extend/override the default implementation
13 replies
CC#
Created by spicedruid on 6/23/2023 in #help
❔ Make interface deriving from another interface have a sealed implementation of a function
If you don't put the one that has the default implementation onto the class that is implementing the interface, does it complain that there is no implementation?
13 replies
CC#
Created by Fjärilsmannen on 6/23/2023 in #help
How do you get the output type from a powershell script with System.Management.Automation?
That should get you the idea of how to get it
21 replies
CC#
Created by Fjärilsmannen on 6/23/2023 in #help
How do you get the output type from a powershell script with System.Management.Automation?
If you are referring to reading this from C#:
var attr = instance.GetType()
.GetProperty("MyProp")
.GetCustomAttributes<OutputTypeAttribute>()
.SingleOrDefault()
var val = attr.Value;
var attr = instance.GetType()
.GetProperty("MyProp")
.GetCustomAttributes<OutputTypeAttribute>()
.SingleOrDefault()
var val = attr.Value;
21 replies
CC#
Created by spicedruid on 6/23/2023 in #help
❔ Make interface deriving from another interface have a sealed implementation of a function
13 replies
CC#
Created by spicedruid on 6/23/2023 in #help
❔ Make interface deriving from another interface have a sealed implementation of a function
Not sure about the sealed part
13 replies
CC#
Created by spicedruid on 6/23/2023 in #help
❔ Make interface deriving from another interface have a sealed implementation of a function
It should be available in C# 8
13 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
ok so the number of resolvers to send gets unwieldy
14 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
And I would accept that as a valid solution if it were me
14 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
Which is the trade-off you have to decide you would rather deal with, one or the other. Which one is more convenient to you?
14 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
Let the mapper handle the parts that directly read off of data, and calculated equations to a separate action
14 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
I usually pull those parts of maps out of the mapping class and just do them after-the-fact
14 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
public static PublicAd MapToPublicAd(this Ad ad, User user, IDistanceResolver resolver) Distance = resolver.Resolve(ad, user) public static PublicAd MapToPublicAd(this Ad ad, User user, decimal distance) Distance = distance
14 replies
CC#
Created by Scottek utek on 6/22/2023 in #help
❔ ✅ custom mapper and resolvers
The code calling the MapToPublicAd method can pass in the IDistanceResolver as an arg for it to call, or you'll have to call it outside the func and then pass in the value for the Distance prop
14 replies
CC#
Created by ksawio on 6/22/2023 in #help
❔ How to acquire license for wpf application
4 replies
CC#
Created by DDarkness on 6/21/2023 in #help
❔ Visual Studio 2022 Super Slow Since The Last Update
Sometimes nuking the .vs folder helps
7 replies
CC#
Created by Jothay on 6/21/2023 in #help
Source Generator Auto Update Extension
Noting we found the bug. The extension needs to recursively check folders for the project name, or otherwise know the more direct path. It worked fine when the project in question was just at the root level.
11 replies
CC#
Created by Jothay on 6/21/2023 in #help
Source Generator Auto Update Extension
Sure
11 replies
CC#
Created by Jothay on 6/21/2023 in #help
Source Generator Auto Update Extension
Currently living in TX
11 replies