@@ -12,43 +12,67 @@ namespace Resgrid.Model
1212 public class MapLayer : NoSqlDocument
1313 {
1414 [ BsonElement ( "departmentId" ) ]
15+ [ JsonProperty ( PropertyName = "departmentId" ) ]
1516 public int DepartmentId { get ; set ; }
1617
1718 [ Required ]
1819 [ MaxLength ( 250 ) ]
1920 [ BsonElement ( "name" ) ]
21+ [ JsonProperty ( PropertyName = "name" ) ]
2022 public string Name { get ; set ; }
2123
2224 [ BsonElement ( "type" ) ]
25+ [ JsonProperty ( PropertyName = "type" ) ]
2326 public int Type { get ; set ; }
2427
2528 [ Required ]
2629 [ MaxLength ( 50 ) ]
2730 [ BsonElement ( "color" ) ]
31+ [ JsonProperty ( PropertyName = "color" ) ]
2832 public string Color { get ; set ; }
2933
3034 [ BsonElement ( "data" ) ]
35+ [ JsonProperty ( PropertyName = "data" ) ]
3136 public MapLayerData Data { get ; set ; }
3237
3338 [ BsonElement ( "isSearchable" ) ]
39+ [ JsonProperty ( PropertyName = "isSearchable" ) ]
3440 public bool IsSearchable { get ; set ; }
3541
3642 [ BsonElement ( "isOnByDefault" ) ]
43+ [ JsonProperty ( PropertyName = "isOnByDefault" ) ]
3744 public bool IsOnByDefault { get ; set ; }
3845
3946 [ BsonElement ( "addedById" ) ]
47+ [ JsonProperty ( PropertyName = "addedById" ) ]
4048 public string AddedById { get ; set ; }
4149
4250 [ BsonElement ( "addedOn" ) ]
51+ [ JsonProperty ( PropertyName = "addedOn" ) ]
4352 public DateTime AddedOn { get ; set ; }
4453
4554 [ BsonElement ( "isDeleted" ) ]
55+ [ JsonProperty ( PropertyName = "isDeleted" ) ]
4656 public bool IsDeleted { get ; set ; }
4757
4858 [ BsonElement ( "updatedById" ) ]
59+ [ JsonProperty ( PropertyName = "updatedById" ) ]
4960 public string UpdatedById { get ; set ; }
5061
5162 [ BsonElement ( "updatedOn" ) ]
63+ [ JsonProperty ( PropertyName = "updatedOn" ) ]
5264 public DateTime UpdatedOn { get ; set ; }
65+
66+ [ BsonIgnore ( ) ]
67+ [ JsonProperty ( PropertyName = "id" ) ]
68+ public string PgId { get ; set ; }
69+
70+ public string GetId ( )
71+ {
72+ if ( ! String . IsNullOrWhiteSpace ( PgId ) )
73+ return PgId ;
74+
75+ return Id . ToString ( ) ;
76+ }
5377 }
5478}
0 commit comments