I asked this on SO and got skewered. I love SO for the answers, but asking a question is fraught with peril. I'm new here, but I'm hopeful y'all will be more forgiving and helpful.
if I:
dotnet new console -f netcoreapp3.1 -n four
add to Program.cs
Console.WriteLine("Namespace: {0}"...
var types = Assembly.GetExecutingAssembly().GetTypes().Where(t => String.Equals(t.Namespace, "SomeNamespace", StringComparison.Ordinal)).ToArray();
foreach (Type T in types)
{
//Neither of these will work
var foo = Activator.CreateInstance(typeof(`What would I put...
We just redesigned, and rewrote, our application with brand new designed database schema.
My next job is to write c# code that will convert and move the data from the old database to the new database.
.
I'm a simple man. I just want to read the data, massage the data to convert it to the new...
Big Picture
I maintain a large web application with the primary function of managing orders. It is an MVC over C# application using EF6 for data. There are LOTS of search screens. Right now every search is coded without any code re-use (before my time, I swear!).
What I'm Trying To Do
I'm...
Hello :joyous:,
I am doing C# for a half year now. Today I want to call a method like this in a class with the name "A":
public T TheMethod<T>(IRestResponse response) {
...
}
At compile time, T isn't known.
var theType = typeof(B);
So I tried the following:
var gMethod=...
I'm using an "object factory/pool" to store sprites. I have it set up so that:
ASprite tmp = spritePool.GetObject();
tmp.state = 133;
Will make a new object for tmp, then set its state to 133. All the objects in the pool are stored in an array.
Now, I want to populate that pool by...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.