public IHttpActionResult Delete(Guid id)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var friendShipBindingModel = new FriendShipBindingModel()
                    {
                        Id = id
                    };
                    var freindShipModel = Mapper.Map <FriendShipBindingModel, FriendShip>(friendShipBindingModel);
                    _friendShipService.Delete(freindShipModel.Id);

                    return(Ok());
                }
                catch (Exception ex)
                {
                    var result = ex.Message;
                }
            }
            else
            {
                return(BadRequest(ModelState));
            }
            return(Ok(StatusCode(HttpStatusCode.BadRequest)));
        }
        public IHttpActionResult CreateFriendShip(FriendShipBindingModel friendShip)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var freindShipModel = Mapper.Map <FriendShipBindingModel, FriendShip>(friendShip);

                    var requestedToId = freindShipModel.RequestedToId;

                    freindShipModel.RequestedById = Guid.Parse(User.Identity.GetUserId());
                    var requestedById = freindShipModel.RequestedById;

                    _friendShipService.CreateFriendship(requestedById, requestedToId);

                    return(Ok());
                }
                catch (Exception ex)
                {
                    var result = ex.Message;
                }
            }
            else
            {
                return(BadRequest(ModelState));
            }
            return(Ok(StatusCode(HttpStatusCode.BadRequest)));
        }
        public IHttpActionResult Update(FriendShipBindingModel friendShip)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var freindShipModel = Mapper.Map <FriendShipBindingModel, FriendShip>(friendShip);

                    var appUser = User.Identity.GetUserId();
                    freindShipModel.Id = Guid.Parse(appUser);

                    _friendShipService.Update(freindShipModel);

                    var friendShipUpdated = _friendShipService.GetById(freindShipModel.Id);

                    var friendShipBindingModel = Mapper.Map <FriendShip, FriendShipBindingModel>(friendShipUpdated);
                    return(Ok(friendShipBindingModel));
                }
                catch (Exception ex)
                {
                    var result = ex.Message;
                }
            }
            else
            {
                return(BadRequest(ModelState));
            }
            return(Ok(StatusCode(HttpStatusCode.BadRequest)));
        }