// POST api/values public HttpResponseMessage Post(PublicPost post) { var NewPost = new Post { Title = post.Title, Descritpion = post.Description, ImageFile = post.ImagePath, CreatedAt = DateTime.Now }; context.Posts.Add(NewPost); context.SaveChanges(); var createdPost = Get(NewPost.Id); return(Request.CreateResponse <Post>(HttpStatusCode.Created, createdPost)); }
public void GetAll() { var NewPublicPost = new PublicPost { Title = "Enyaanya", Description = "Nuunji nyo", ImagePath = "path to file" }; var post = new Post { Title = NewPublicPost.Title, Descritpion = NewPublicPost.Description, ImageFile = NewPublicPost.ImagePath, CreatedAt = DateTime.Now, }; Assert.Fail(); }