Beispiel #1
0
        public virtual async Task <IActionResult> Post([FromBody] T value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var added = await repository.AddAsync(value);

            await unitOfWork.CommitAsync();

            return(CreatedAtRoute(routeValues: new { id = added.Id }, value: added));
        }