I have the object:
public class Object{
public String ID{get;set;}
}
And my software receive a List:
List<Object> objs = new List<Object>();
objs.add(new Object{ID = "1"});
objs.add(new Object{ID = "2"});
objs.add(new Object{ID = "3"});
objs.add(new Object{ID = "4"});
And then I randomize it:
objs = objs.OrderBy(a => Guid.NewGuid()).ToList();
Debug.WriteLine(objs.ID);
// 1 4 2 3
If I execute objs.OrderBy(a => Guid.NewGuid()).ToList();
i'm going to receive another random sequence // 3 2 4 1
.
I need to pass a "seed"(a integer number) and randomize about this number, for example, if I pass the seed 1
I receive // 3 2 4 1
, when I execute the number 1 again i need to receive the same order // 3 2 4 1
.
There is a way to do it in c#?
Edit: The object above is just a example, the real case i need to randomize the following object:
public class Object{
public Int ID{get;set;}
public String ImageTitle{get;set;}
public String ImageDescription{get;set;}
public String Url {get;set;}
}