Example #1
0
        protected async Task <IActionResult> AddAsync(TContract contract, Func <TItem, object> id)
        {
            var item = AdminMapper.Map <TItem>(contract);

            if (TryValidateModel(item))
            {
                item = await AdminStore.AddAsync(item);

                return(Created("", item));
            }

            return(BadRequest());
        }