Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added exception when a member map is used with an _id alias.

  • Loading branch information...
commit e04ebe2aeccd3297c3a8819ac5f6db3302226afe 1 parent 804c3fd
@craiggwilson craiggwilson authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  source/MongoDB/Configuration/Mapping/Model/ClassMapBase.cs
View
3  source/MongoDB/Configuration/Mapping/Model/ClassMapBase.cs
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.