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