コード例 #1
0
        public IHttpActionResult Update(Rp3.Test.Common.Models.Account account)
        {
            using (DataService service = new DataService())
            {
                Rp3.Test.Data.Models.Account accountModel = new Test.Data.Models.Account();
                accountModel.Email     = account.Email;
                accountModel.FullName  = account.FullName;
                accountModel.AccountId = account.AccountId;

                service.Accounts.Update(accountModel);
                service.SaveChanges();
            }

            return(Ok(true));
        }
コード例 #2
0
        public IHttpActionResult Insert(Rp3.Test.Common.Models.Account account)
        {
            using (DataService service = new DataService())
            {
                Rp3.Test.Data.Models.Account accountModel = new Test.Data.Models.Account();
                accountModel.Email    = account.Email;
                accountModel.FullName = account.FullName;

                accountModel.AccountId = service.Accounts.GetMaxValue <int>(p => p.AccountId, 0) + 1;

                service.Accounts.Insert(accountModel);
                service.SaveChanges();
            }

            return(Ok(true));
        }