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