Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
2 votes
0 answers
109 views

I recently discovered MethodRental and it seems really interesting, coming from JS, being able to pre-empt existing functions can be a neat hacky get-out-of-jail card for the toolbelt. As an aside, ...
0 votes
1 answer
89 views

I am extending my C# J2K library to dynamically register codecs from other assemblies. That part is working, but I am having trouble understanding IsAssignableFrom(TypeInfo) and how I can deduce which ...
0 votes
2 answers
73 views

I'm currently working on a console application that essentially mimics an ASP.NET Web API. Everything was going smoothly until I ran into an issue regarding route attributes. What I'm trying to ...
0 votes
1 answer
101 views

I use .NET 9 and blazor, ASP.NET Core Identity - role, policy, claim. To differentiate access on pages and components, the code is using policies - like this: @attribute [Authorize(Policy("...
-1 votes
1 answer
70 views

I got tired of dealing with properties and fields separately so I made a VariableInfo strategy pattern to handle both without having to know what type it is. You feed the context a FieldInfo or a ...
2 votes
1 answer
266 views

The short of it is that I got tired of dealing with properties and fields separately. I made a VariableInfo strategy pattern to handle both without having to know what type it is. You feed the context ...
2 votes
0 answers
47 views

Is there a way to use reflection to programmatically inspect and determine if a given compiled cmdlet requires elevation? Notes: This question concerns compiled cmdlets, not script (text) files. ...
0 votes
1 answer
86 views

PROBLEM TO SOLVE I'm trying to create a mock of interface ISomeService using Moq library which will wrap its real implementation SomeService. Right now I'm doing this manually like this: var instance =...
3 votes
1 answer
129 views

I need some way of constructing a function pointer type that points to a specific function signature. So something like this: Type[] args = [typeof(int), typeof(int)]; // Pointer to (int -> int) ...
-1 votes
2 answers
135 views

My class looks something like this: public class Test { public A[] ArrayA { get;set; } } public class A { public string P1 { get;set; } public int P2 { get;set; } } Suppose I have two ...
2 votes
2 answers
198 views

using System; using System.Runtime.InteropServices; using System.Reflection; public struct StructCreatedByUser { public int x; public float anything; public string name; } class Program { ...
1 vote
1 answer
123 views

Preamble: I was looking at how best to implement a general-purpose decorator in C# that copes with async methods. Most examples use DispatcherProxy, which only offers a synchronous Invoke. Unless NET ...
2 votes
2 answers
140 views

I need to invoke a given DynamicObject with a given array of arguments. However, I am struggling on how exactly to do this. What I would like to do: using System.Dynamic; using System.Reflection; ...
user avatar
0 votes
2 answers
78 views

Given the following sample POCO class: public class TestClass { public int Id { get; init; } public TestClass() {} } How can I initialize the Id property using Reflection? The result should ...
-2 votes
2 answers
143 views

I want to activate, via reflection automatically and recursively all the nested classes inside a class I am instantiating. Here is the template of what I am trying to do, but I do not know how to make ...

15 30 50 per page
1
2 3 4 5
...
77

AltStyle によって変換されたページ (->オリジナル) /