I don't want to include relations in my edmx entity framework, I want to have the foreign key field as a normal property in my entity.
How can I do that?
If you want plain foreign keys in your database then you're using the wrong one. As far as I know entity framework made sure all those obscure id's were thrown away and replaced with pointers to the entity you need. If you really want those foreign keys then you should look into a different database.
http://www.thedatafarm.com/blog/2007/09/11/EntityDataModelAssociationsWheresMyForeignKey.aspx
I found the article describing the error in our ways... basically we never supposed to be querying tables via foreign keys instead take a bit more relational approach
(From o In nw.Orders
Where o.OrderID = 10281
Select o.Customers
).First
I take it that you're trying to access a table say Contact that has a foreign key SubscriberId in it, now say you want to add a Contact with Foreign key 1, example below instead of hacking away at edmx.
using (BulkSmsEntities ctx = new BulkSmsEntities())
{
int SubscriberId = 1;
tb_contact contact = new tb_contact();
contact.tb_subscriber = ctx.tb_subscriber
.First(a => a.SubscriberId == SubscriberId);
ctx.AddTotb_subscriber_contacts(contact);
ctx.SaveChanges();
}