示例#1
0
 public Person(string firstname, string lastname, string twitter)
 {
     Id        = StaticPersistentStore.GetNextId();
     FirstName = firstname;
     LastName  = lastname;
     Twitter   = twitter;
 }
        public IActionResult Post([FromBody] Delta <Article> article)
        {
            var newArticle = article.ToObject();

            newArticle.Id = StaticPersistentStore.GetNextId();
            StaticPersistentStore.Articles.Add(newArticle);
            return(CreatedAtAction("Get", new { id = newArticle.Id }, newArticle));
        }
        public IHttpActionResult Post([FromBody] Delta <Article> article)
        {
            var newArticle = article.ToObject();

            newArticle.Id = StaticPersistentStore.GetNextId();
            StaticPersistentStore.Articles.Add(newArticle);

            return(Created(LinkForGet(newArticle.Id), newArticle));
        }
示例#4
0
 public Comment(string body)
 {
     Id   = StaticPersistentStore.GetNextId();
     Body = body;
 }
示例#5
0
 public Person()
 {
     StaticPersistentStore.GetNextId();
 }