I have an abstract class that other classes are inheriting this.
public abstract class GenericAccess<TEntity>
{
public static IList<TEntity> GetObjectListFromArray(int[] IDs)
{
//Your help need is here.
}
}
public class Doors : GenericAccess<DoorEntity>
{
}
public class DoorEntity
{
public int Id { get; set; }
public string Name { get; set; }
}
I need to create a generic method so when I can for example
IList<DoorEntity> Doors.GetObjectListFromArray(int[] {1,2,3,4,5});
it will return an IList having all the objects in it with the property Id loaded with the value passed. In the above example it will return a list with 5 items in the list with the Id of DoorEntity loaded.