hi,
after login how to insert Identity name in angular using web api ..
i failed to insert identity name
it is in web api
- public IHttpActionResult addcomment(CommentTable objcomment, string id) {
- int Id = Convert.ToInt32(id);
- string loggedInUserId = User.Identity.GetUserId();
- objcomment.CommentedDate = DateTime.Now;
- objcomment.id = Id;
- objcomment.UserID = loggedInUserId;
- objcomment.CreatedBy = User.Identity.Name;
- ctx.CommentTables.Add(objcomment);
- ctx.SaveChanges();
- return Ok(objcomment);
- }
how to resolve these