[Solved] How to create a method that allows arrays to act like single values?

Do not use this answer, just use Select() method much simpler. class Program { static void Main(string[] args) { string[] s = new string[] { “hi”, “hello”, “what’s up” }; string[] newS = s.ArrayTo<string>(x => x.Remove(0, 1) ); foreach (string str in newS) Console.WriteLine(str); } } static class Ext { public static T[] ArrayTo<T>(this T[] … Read more

[Solved] How to capture value OOPS & Generic [closed]

While looking at your code, why would one want to read class specific properties in a generic method? The only solutions i see is to use Reflection, or create an abstract base class with a before save method and call that method in de Save() method. Add a generic type constraint to the DBObject class … Read more

[Solved] Create a base fluent ordered constructor

I solved using Generics in this way in the BaseFactory: public T Create<T>() { return (T)Activator.CreateInstance(typeof(T), this); } then my DerivedFactory is simply this: namespace FunzIA.DL.Factory { public class SocietyFactory : BaseFactory {} } so i can write Society actual = SocietyFactory.InitCreation() .WithCode(idExpected) .Create<Societa>(); solved Create a base fluent ordered constructor