// POST api/account
 public HttpResponseMessage Post(Account account)
 {
     try
     {
         _manager.CreateNew(account);
         return(GetResponse(account.Id.ToNullSafeString()));
     }
     catch (Exception e)
     {
         return(GetResponse(e));
     }
 }
Beispiel #2
0
        public ActionResult CreateNewAccount(User newAccount)
        {
            //TODO(AngelM): Check if it worth to expose a Web API method
            newAccount.IsActive = true;

            BusinessOperationResult <bool> result = accountManager.CreateNew(newAccount);

            if (result.IsError)
            {
                return(new GenericStateResult(result.Messages));
            }

            return(new GenericStateResult());
        }