I'm trying to create an application where I'm using Windows Identity and Entity Framework Code First. So I'm creating a custom class to save some data.
public class Order {
public string Name { get; set; }
public DateTime CreatedDate { get; set; }
public IdentityUser User { get; set; }
}
Now I'm trying to link the user table to the order table (as generated by Entity Framework). So that I can do Order.User to get user info on the user who created the Order.
I want to create a new order using
new Order {
Name = "Test",
CreatedDate = new DateTime(2014, 3, 30),
User = <What goes here?>
}
Now how to I get "IdentityUser" of the currently logged in user? Or am I going about this the wrong way?