this is my controller action method-------
public HttpResponseMessage PostPost(Post post)
{
// previosly i was using simple membership to get id of logged in user
// post.PostedBy = WebSecurity.CurrentUserId;
post.PostedBy = User.Identity.GetUserId<int>();
post.PostedDate = DateTime.UtcNow;
ModelState.Remove("post.PostedBy");
ModelState.Remove("post.PostedDate");
if (ModelState.IsValid)
{
db.Posts.Add(post);
db.SaveChanges();
// now i am facing problem at this line. it is saying that
//Operator '==' cannot be applied to operands of type 'int' and 'string'
var usr = db.Users.FirstOrDefault(x => x.Id == post.PostedBy);
my code was working fine when i was using simple membership.what should i try to make it working. here, post is a class with property PostedBy as int and i want to assign current loggedIn userId value to this property.