title: How to insert a record into entity based on an action on another entity?
body: <p>I have two disconnected models. The first one is Event, which is in simplified form below:</p>
  <pre><code>public partial class Event
      {
          public int EventID { get; set; }
          public string Subject { get; set; }
         ...
          public string Status { get; set; }
  
      }
  </code></pre>
  <p>The second is the Tickets model, derived from the Event SQL table. The Tickets model shows open tickets only:</p>
  <pre><code>with ds as (select distinct subject from events 
  except 
  select distinct subject from events where status like 'Closed%')
  
      select isnull(cast(ROW_NUMBER() OVER(ORDER BY [subject] ASC)  as int),0) as [TicketId], subject as Ticket from ds
  </code></pre>
  <p>The Tickets model is below:</p>
  <pre><code>public partial class Tickets
  {
      public int TicketId { get; set; }
      public string Ticket { get; set; }
  }
  </code></pre>
  <p>Now, I want on clicking on the ActionLink on the Tickets view to insert a new event into the Event SQL database. Something like clicking on the:</p>
  <pre><code>@Html.ActionLink(&quot;Resolve&quot;, &quot;Create&quot;, new { id=item.TicketId })
  </code></pre>
  <p>Would fire up the following action in the Tickets controller:</p>
  <pre><code>[HttpPost]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Create([Bind(Include = &quot;Subject&quot;)] Event events)
      {
          if (ModelState.IsValid)
          {
              db.Events.Add(events);
              await db.SaveChangesAsync();
              return RedirectToAction(&quot;Index&quot;);
          }
  
          return View(events);
      }
  </code></pre>
  <p>The issue is that because the Tickets is a SQL view, it does not accept any CREATE/UPDATE/DELETE actions.</p>
  <p>Is there a way around it? Thanks</p>