예제 #1
0
        public void InsertUserData(List <UserData> data)
        {
            //create new data context
            var dataSpace = new dataLinqDataContext();
            //get needed table from data context
            var            usrTable = dataSpace.GetTable <usersTestTable>();
            usersTestTable tbl;
            bool           online = false;

            //query and parsing here:
            foreach (UserData userdat in data)
            {
                tbl = new usersTestTable(userdat.name,
                                         userdat.email, userdat.passHash, userdat.gender, userdat.userpic.ToString(), online);
                dataSpace.usersTestTables.InsertOnSubmit(tbl);
            }

            try
            {
                dataSpace.SubmitChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            //Close data context
            dataSpace.Dispose();
            // throw new NotImplementedException();
        }
예제 #2
0
 partial void DeleteusersTestTable(usersTestTable instance);
예제 #3
0
 partial void UpdateusersTestTable(usersTestTable instance);
예제 #4
0
 partial void InsertusersTestTable(usersTestTable instance);