on-internet
← Community

The member with identity ' ' does not exist in the metadata collection.\r\nParameter name: identity

Stack Overflow ·

I simplified the code a little while trying to debug: [HttpPost] public ActionResult Register(User model) { DateTime bla = new DateTime(2012, 12, 12); try { User user = new User { gid = 1, cid = 1, firstName = model.firstName, lastName = model.lastName, email = model.email, username = model.username, password = model.password, creationDate = bla, active = 1 }; myContext.Users.AddObject(user); myContext.SaveChanges(); } catch (Exception ex) { throw ex; } return View(); } The values are transmited accordingly. Users table: [id] [int] IDENTITY(1,1) NOT NULL, [cid] [int] NULL, [gid] [int] NULL, [f

Comments

Sign in or sign up to comment and upvote.

No comments yet.