public string AddUser(User user) { // Check the User Name of the current requested User from Existing Users IEnumerable <User> Users = IUserRepos.GetUsers(); bool duplications = false; foreach (var item in Users) { if (item.UserName == user.UserName || item.MailID == user.MailID) { duplications = true; } } if (!duplications) { return(IUserRepos.AddUser(user)); } else { return("Duplication Not Allowed In UserName and Email!"); } }