public static ObjectConfig ToMongoEntity(this ObjectConfigContract objectConfig)
 {
     return(new ObjectConfig
     {
         Id = objectConfig.Id,
         Title = objectConfig.Title,
         Properties = objectConfig.Properties.Select(x => x.ToMongoEntity()).ToArray()
     });
 }
Example #2
0
 public async Task Update(ObjectConfigContract objectConfig)
 {
     objectContext = new ObjectContext();
     await objectContext.ObjectConfigs.ReplaceOneAsync(Builders <ObjectConfig> .Filter.Eq("Id", objectConfig.Id), objectConfig.ToMongoEntity());
 }
Example #3
0
 public async Task Create(ObjectConfigContract objectConfig)
 {
     objectContext = new ObjectContext();
     await objectContext.ObjectConfigs.InsertOneAsync(objectConfig.ToMongoEntity());
 }