Esempio n. 1
0
        public HttpResponseMessage Edit([FromBody] API.AccountComplete accountComplete)
        {
            var account = Mapper.Map <API.Account, D.Account>(accountComplete.Account);
            var profile = Mapper.Map <API.AccountProfile, D.AccountProfile>(accountComplete.Profile);

            Service.Edit(account, profile);
            return(Request.CreateResponse(HttpStatusCode.OK));
        }
Esempio n. 2
0
        public HttpResponseMessage Create([FromBody] API.AccountComplete accountComplete)
        {
            var account = Mapper.Map <API.Account, D.Account>(accountComplete.Account);
            var profile = Mapper.Map <API.AccountProfile, D.AccountProfile>(accountComplete.Profile);

            try
            {
                Service.Create(account, profile);
                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (InvalidUserException ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message));
            }
        }