Пример #1
0
        public async Task <IHttpActionResult> Create([FromBody] dynamic viewmodel)
        {
            string flat          = viewmodel.flat;
            int?   count         = viewmodel.count;
            var    flatViewModel = JsonConvert.DeserializeObject <FlatViewModel>(flat);

            var model  = Mapper.Map <Flat>(flatViewModel);
            var result = await _flatService.Create(model, count);

            return(Ok(Mapper.Map <FlatViewModel>(result)));
        }