public static Car CreateCar(string license) { return(new Car { LicenceNumber = license, Created = SystemTime.Current(), Modified = SystemTime.Current(), }); }
// PUT api/<controller>/5 public void Put(int id, [FromBody] IncomingBlog blog) { var updatePost = _service.GetById(id); updatePost.Title = blog.Title != null ? blog.Title : updatePost.Title; updatePost.Body = blog.Body != null ? blog.Body : updatePost.Body; updatePost.Modified = SystemTime.Current(); _service.Upsert(updatePost); }
public static Post CreatePost(string title, string body) { return(new Post { Title = title, Body = body, Created = SystemTime.Current(), Modified = SystemTime.Current(), }); }