示例#1
0
        // POST: api/Groups
        public async Task <string> Post(GroupDto entity)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }
            var groupId = await GroupGenericFacade.CreateAsync(entity);

            if (groupId.Equals(0))
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            return($"Created Group with id: {groupId}");
        }