Esempio n. 1
0
        public async Task <ActionResult <Customer> > CreateNewWaitingAdmin([FromBody] Administrator administrator)
        {
            long id;

            try
            {
                id = await Task.Run(() => m_facade.AddNewWaitingAdmin(administrator));
            }
            catch (DuplicateDetailsException ex)
            {
                return(StatusCode(400, $"{ex.Message}"));
            }
            administrator.Id = id;
            return(Created($"api/Anonymous/CreateNewWaitingAdmin/{id}", JsonConvert.SerializeObject(administrator)));
        }