Skip to content

Commit

Permalink
added exception when a member map is used with an _id alias.
Browse files Browse the repository at this point in the history
  • Loading branch information
craiggwilson committed Jun 24, 2010
1 parent 804c3fd commit e04ebe2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/MongoDB/Configuration/Mapping/Model/ClassMapBase.cs
Expand Up @@ -219,6 +219,9 @@ internal void AddMemberMap(PersistentMemberMap memberMap)
/// <param name = "memberMaps">The member maps.</param>
internal void AddMemberMaps(IEnumerable<PersistentMemberMap> memberMaps)
{
if (memberMaps.Any(m => m.Alias == "_id"))
throw new MongoException("_id is a reserved MongoDB alias and cannot be used for anything other than an Id column.");

_memberMaps.AddRange(memberMaps);
}

Expand Down

0 comments on commit e04ebe2

Please sign in to comment.