示例#1
0
        public ActionResult Index()
        {
            var context = new FbmContext();

            context.Towns.Add(new Town()
            {
                Name = "Sofia"
            });
            context.SaveChanges();
            return(View());
        }
        public HttpResponseMessage PostComment(PostCommentModel model)
        {
            var studioId = int.Parse(model.Id);

            context.Comments.Add(new Comment()
            {
                Author   = model.Author,
                Content  = model.Comment,
                StudioId = studioId,
            });
            context.SaveChanges();

            return(new HttpResponseMessage(HttpStatusCode.Created));
        }