public int SaveWeChatCustomer(Customer customer) { var currentCustomer = GetByOpenId(customer.WechatId); if (currentCustomer == null) Insert(customer); else Update(currentCustomer); return 1; }
public int Insert(Customer customer) { return Ctx.Insert<Customer>("Customer", customer).AutoMap(x => x.CustomerId).ExecuteReturnLastId<int>(); }
public int Update(Customer customer) { return Ctx.Update("Customer", customer).AutoMap(x => x.CustomerId).Where(x => x.CustomerId).Execute(); }
public IHttpActionResult SaveFromWeChat(Customer customer) { return Ok(); }