public string OnUserCreate(string args) { var Input = JsonConvert.DeserializeObject<UserCreateInput>(args); var Result = new UserCreateOutput(); if(!DbHolding.User.IsExist(Input.UserName)) { var user = new User() { nickname = Input.UserName, pass = Input.UserPass, }; var id = DbHolding.User.Create(user); Result.ResultStatus = ResultStatus.SuccessStatus; Result.UserId = id; } var Output = JsonConvert.SerializeObject(Result); return Output; }
public bool Update(User obj) { return col.Update(obj.id, obj); }
public int Create(User obj) { var r = col.Insert(obj); return r.AsInt32; }