public void demo_select_join() { UserInfoM tb = new UserInfoM(); tb.innerJoin("$.user_link l").on("user_id = l.user_id") .where ("id=?", 22) .select("*"); }
public void demo_update() { UserInfoM tb = new UserInfoM(); tb.sex = 1;//男的 tb.where ("id=?", 22).update(); }
public void demo_insert() { UserInfoM tb = new UserInfoM(); tb.userID = 12; tb.sex = 1;//男的 tb.insert(); }
public void demo_update3() { var data = new Dictionary <string, object>(); UserInfoM tb = new UserInfoM(); tb.where ("id=?", 22).update((key) => { switch (key) { case "sex": return(1); case "name": return("cc"); default: return(null); } }); }
public void demo_update2() { var data = new Dictionary <string, object>(); UserInfoM tb = new UserInfoM(); tb.where ("id=?", 22).update((key) => { if (data.ContainsKey(key)) { return(data[key]); } else { return(null); } }); }
public void demo_insert2() { var data = new Dictionary <string, object>();//或其它字段类 UserInfoM tb = new UserInfoM(); tb.insert((key) => { if (data.ContainsKey(key)) { return(data[key]); } else { return(null); } }); }
public async Task <UserInfoM> GetUserInfo(string token) { UserInfoM result = null; using (var client = new HttpClient()) { var discovery = await DiscoveryService.GetDiscovery(); var response = await client.GetUserInfoAsync(new UserInfoRequest { Address = discovery.UserinfoEndpoint, Token = token }); if (response.IsError) { throw new Exception(response.Error); } result = Mapper.Map <UserInfoM>(response); } return(result); }
public void demo_select() { UserInfoM tb = new UserInfoM(); tb.where ("id=?", 22).select("*"); }
public void demo_delete() { UserInfoM tb = new UserInfoM(); tb.where ("id=?", 22).delete(); }