コード例 #1
0
        public IHttpActionResult PostFriendship(Friendship friendship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _friendshipService.CreateFriendship(friendship.ProfileA.Id, friendship.ProfileB.Id);

            return(CreatedAtRoute("DefaultApi", new { id = friendship.Id }, friendship));
        }