public IHttpActionResult Post([FromBody] DateAndTimeOfDayModel dt) { Assert.NotNull(dt); Assert.Equal(99, dt.Id); Assert.Equal(new DateTime(2099, 1, 1), dt.Birthday); Assert.Equal(new TimeSpan(0, 13, 14, 15, 219), dt.CreatedTime); return(Created(dt)); }
public IHttpActionResult Get(int key) { DateAndTimeOfDayModel dtm = db.DateTimes.FirstOrDefault(e => e.Id == key); if (dtm == null) { return(NotFound()); } return(Ok(dtm)); }