public ActionResult AssignToProject(int Id, string Type)
        {
            AssignToProjectModel model = new AssignToProjectModel();

            model.Project = database.Projects.FirstOrDefault(p => p.ProjectId == Id);
            var user = database.Users.FirstOrDefault(u => u.UserName == User.Identity.Name);

            if (string.IsNullOrEmpty(Type))
            {
                var ret = from ac in user.AuthenticationAccounts
                          select ac;
                model.Accounts = ret.ToArray();
            }
            else
            {
                var ret = from ac in user.AuthenticationAccounts
                          where ac.AccountProvider.ToLower() == Type.ToLower()
                          select ac;
                model.Accounts = ret.ToArray();
            }
            if (null != model.Project)
            {
                return(View(model));
            }
            return(Content("Invalid Project"));
        }
 public ActionResult AssignToProject(int Id, string Type)
 {
     AssignToProjectModel model = new AssignToProjectModel();
     model.Project = database.Projects.FirstOrDefault(p => p.ProjectId == Id);
     var user = database.Users.FirstOrDefault(u => u.UserName == User.Identity.Name);
     if (string.IsNullOrEmpty(Type))
     {
         var ret = from ac in user.AuthenticationAccounts
                   select ac;
         model.Accounts = ret.ToArray();
     }
     else
     {
         var ret = from ac in user.AuthenticationAccounts
                   where ac.AccountProvider.ToLower() == Type.ToLower()
                   select ac;
         model.Accounts = ret.ToArray();
     }
     if (null != model.Project)
     {
         return View(model);
     }
     return Content("Invalid Project");
 }