Beispiel #1
0
        public HttpResponseMessage AddSubscribe(UserChannelRequest channel, int id)
        {
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }

            UserService userSrv = new UserService();

            channel.UserId = userSrv.GetCurrentUserId();
            if (id == 0)
            {
                id = 4;
            }
            channel.ChannelId = id;
            ChannelService svc = new ChannelService();

            svc.Channel_InsertUserId(channel);

            return(Request.CreateResponse(HttpStatusCode.OK, new SuccessResponse()));
        }