示例#1
0
        public async Task <IActionResult> Post([FromBody] FieldChangeGroup item)
        {
            return(await FunctionWrapper.ExecuteFunction(this, async() => {
                if (item.ItemId == ObjectId.Empty)
                {
                    throw new ApplicationException("Required fields not supplied.");
                }

                return await _fieldChangeGroupRepository.Add(item);
            }));
        }
        public async Task <FieldChangeGroup> Add(FieldChangeGroup item)
        {
            try
            {
                await _context.FieldChangeGroups.InsertOneAsync(item);

                return(await Get(item.Id));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }