Advertisement
Guest User

Untitled

a guest
Feb 15th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using Model;
  2. using Model.States;
  3. using MongoDB.Bson.Serialization;
  4.  
  5. namespace Infrastructure.Database
  6. {
  7.     public static class EntityMappings
  8.     {
  9.         public static void Map()
  10.         {
  11.             BsonClassMap.RegisterClassMap<Raspberry>(x =>
  12.             {
  13.                 x.AutoMap();
  14.                 x.SetIgnoreExtraElements(true);
  15.                 x.MapIdMember(y => y.Id);
  16.             });
  17.  
  18.             BsonClassMap.RegisterClassMap<Sensor>(x =>
  19.             {
  20.                 x.AutoMap();
  21.                 x.SetIgnoreExtraElements(true);
  22.                 x.MapIdMember(y => y.Id);
  23.             });
  24.  
  25.             BsonClassMap.RegisterClassMap<SensorState>(x =>
  26.             {
  27.                 x.AutoMap();
  28.                 x.SetIgnoreExtraElements(true);
  29.                 x.MapIdMember(y => y.Id);
  30.             });
  31.  
  32.             BsonClassMap.RegisterClassMap<State>(x =>
  33.             {
  34.                 x.AutoMap();
  35.                 x.SetIgnoreExtraElements(true);
  36.                 x.MapIdMember(y => y.Id);
  37.             });
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement