我的約會有問題。我和郵遞員一起插入,無論我輸入什么,我總是得到“0001-01-01T00:00:00”。
還想將輸出限制為日期。
我非常感謝任何幫助
謝謝
Model:
public class BusinessTripDocument
{
public long Id { get; set; }
public string StartLocation { get; set; }
[JsonPropertyName("startDateTime")]
public DateTime StartDate { get; set; }
public string Destination { get; set; }
public DateTime DestinationDate { get; set; }
public string Transportation { get; set; }
public string SuperiorsApproval { get; set; }
// POST: api/Businesstripdocuments
[HttpPost("new/{eId}")]
public async Task<ActionResult<BusinessTripDocument>> PostBusinesstripdocuments(long eId, BusinessTripDocument businesstripdocuments)
{
Employee employee = await _context.Employees.FindAsync(eId);
// businesstripdocuments.Employee = employee;
// _context.Businesstripdocuments.Add(businesstripdocuments);
employee.addDocument(businesstripdocuments);
await _context.SaveChangesAsync();
return CreatedAtAction("GetBusinesstripdocuments", new { id = businesstripdocuments.Id }, businesstripdocuments);
}

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/393737.html
