Can anyone point me to documentation on how to wrap fields back into a class and return it back to a controller?
I need to do the following:
1. I have populated a group of data (i.e. a Ticket) onto a view based on a ticket ID
2. On the view, the user is able to change the text of the data, then click a button to update the ticket to the new text
the class looks like this:
public class zfTicket:TableEntity
{
public zfTicket()
{
}
public zfTicket(string PartitionKey, string RowKey)
{
this.PartitionKey = PartitionKey;
this.RowKey = RowKey;
}
[Key]
public string TicketId { get; set; }
public string TicketTitle { get; set; }
public string TicketCreationDate { get; set; }
public string AssignedTo { get; set; }
public string Severity { get; set; }
public string TicketText { get; set; }
public string Status { get; set; }
}
The view looks like this:
@model zfCoreTicketing.Models.zfTicket
<div>
<h4>zfTicket</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
<dr> </dr>
<dr> TicketId: <input asp-for="TicketId" /></dr>
<dr> Created Date: <input asp-for="TicketCreationDate" /></dr>
<dr> Title: <input asp-for="TicketTitle" /></dr>
<dr> Assigned To: <input asp-for="AssignedTo" /></dr>
<dr> Severity: <input asp-for="Severity" /></dr>
<dr> Text: <input asp-for="TicketText" /></dr>
<dr> Status <input asp-for="Status" /></dr>
@*<input asp-for="Severity" />
<input asp-for="TicketTitle" />*@
</dt>
</dl>
</div>
<div>
<a asp-action="Edit" asp-route-id="@Model">Edit</a> |
<a asp-action="Index">Back to List</a>
</div>
</form>
** When clicking the Edit action, I want to return all the values from the ticket back to the controller to perform an update