For one-to-one relationships, EF expects that the tables are using the same primary key. And really, if it’s a true one-to-one they probably should. So in your example, if you make UserID the primary key on the UserProfiles table, your one-to-one will work.
More Related Contents:
- Reset Entity-Framework Migrations
- No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’
- How do I delete multiple rows in Entity Framework (without foreach)
- How to mock the limitations of EntityFramework’s implementation of IQueryable
- Batch update/delete EF5
- how to update an entity in Entity Framework 4 .NET
- Should I enable or disable dynamic proxies with entity framework 4.1 and MVC3?
- Entity Framework 4 / POCO – Where to start? [closed]
- Asp.Net Web API Error: The ‘ObjectContent`1’ type failed to serialize the response body for content type ‘application/xml; charset=utf-8’
- “like” queries in Entity Framework
- Querying objects after AddObject before SaveChanges?
- Entity Framework 4.1 default eager loading
- PropertyGrid Browsable not found for entity framework created property, how to find it?
- Entity framework PostgreSQL
- Loop/reflect through all properties in all EF Models to set Column Type
- EF can’t infer return schema from Stored Procedure selecting from a #temp table
- MetadataException when using Entity Framework Entity Connection [duplicate]
- Using Entity Framework with an SQL Compact Private Installation
- How to use Entity Framework to map results of a stored procedure to entity with differently named parameters
- EF Code First foreign key without navigation property
- Nullable property to entity field, Entity Framework through Code First
- LINQ to Entities for subtracting 2 dates
- Entity Framework Code First Using Guid as Identity with another Identity Column
- AutomaticMigrationsEnabled false or true?
- ADO.NET Entity Framework tutorials [closed]
- Entity Framework Code First Many to Many Setup For Existing Tables
- Compose queries across Entity Data Models
- Changing Inherited Types in Entity Framework
- Why is my Entity Framework Code First proxy collection null and why can’t I set it?
- Why does the entity framework need an ICollection for lazy loading?