Beispiel #1
0
        public ActionResult CreateContent(CreateContentRequest req)
        {
            CreateContentResponse response = new CreateContentResponse();
            ContentModel          model    = new ContentModel()
            {
                Link         = req.Link,
                IsActive     = true,
                CreatedDate  = DateTime.Now,
                ModifiedDate = DateTime.Now
            };
            var res = model.CreateContent(model, req.UserId, dbFactory);

            response.link      = req.Link;
            response.id        = res;
            response.userid    = req.UserId;
            response.IsSuccess = true;
            return(Json(response));
        }
Beispiel #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            CreateContentResponse response = new CreateContentResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("content", targetDepth))
                {
                    var unmarshaller = ContentDataUnmarshaller.Instance;
                    response.Content = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }