Results 1 to 4 of 4

Thread: save model from another model

Threaded View

  1. #1

    Thread Starter
    Fanatic Member VBKNIGHT's Avatar
    Join Date
    Oct 2000
    Location
    Port25
    Posts
    619

    save model from another model

    how can i save my model to another same model ?

    Code:
    [HttpPost]
    public ActionResult Create(Employee employee)
    {
          if (ModelState.IsValid)
         {
                db.Employees.Add(employee);
                db.Employees_log.Add(employee); ===> error: "unable to update entityset because it has a definingquery and no insertfunction"
                db.SaveChanges();
         }
    }
    I basically wanted to save two models at the same time.
    Last edited by VBKNIGHT; Apr 25th, 2013 at 01:08 AM.

    If a post has helped you then Please Rate it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width