Skip to content

Instantly share code, notes, and snippets.

@ajpinedam
Last active August 29, 2015 14:04
Show Gist options
  • Save ajpinedam/57f52532b17498c53b1d to your computer and use it in GitHub Desktop.
Save ajpinedam/57f52532b17498c53b1d to your computer and use it in GitHub Desktop.
BanDay C# Script
using (var db = _devDoContextFactory.Create())
{
var userExceptions = {"pinedax", "Melvyn Perez"};
var roleExceptions = {"Admins", "Dioxes"};
var defaultSearch = {"dembow"};
//......
//......
//......
//......
var _random = new Random();
var id = _random.Next(_devDoUsersNumber);
//......
//......
//......
//......
//......
//......
var banUser = db.Users.FirstOrDefault(u => u.Id == id);
if(banUser == null)
{
//......
//......
banUser = db.Users.FirstOrDefault(/*condition cannot be shown*/);
}
//......
//......
//......
// ==> This line was added by Carlos Vasquez on Jul 24 2014
if(banUser == null)
return db.Users.FirstOrDefault(u.User.FirstName == "Ahmed");
return banUser;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment