Пример #1
0
 public static void InsertUserInfo(FormUserInfo userinfo, string channel, string id)
 {
     using (var db = new UserKeywords())
     {
         var UserInfo = new UserInfo();
         UserInfo.GitHubLogin = userinfo.GitHubUID;
         UserInfo.Email       = userinfo.Email;
         UserInfo.channel     = channel;
         UserInfo.userID      = id;
         db.UserInfo.Add(UserInfo);
         db.SaveChanges();
     }
 }
Пример #2
0
 public static void UpdateUserInfo(FormUserInfo userinfo, string channel, string id)
 {
     using (var db = new UserKeywords())
     {
         var UserInfo = new UserInfo();
         UserInfo.GitHubLogin = userinfo.GitHubUID;
         UserInfo.Email       = userinfo.Email;
         UserInfo.channel     = channel;
         UserInfo.userID      = id;
         db.UserInfo.Attach(UserInfo);
         db.Entry(UserInfo).State = EntityState.Modified;
         db.SaveChanges();
     }
 }