|
|
@@ -79,7 +79,7 @@ namespace DataVAPI.ServerDB.MongoDB |
|
|
|
|
|
|
|
public void Modify(string id, string field, string value) |
|
|
|
{ |
|
|
|
var filter = Builders<T>.Filter.Eq("IdStr", id); |
|
|
|
var filter = Builders<T>.Filter.Eq("Id", id); |
|
|
|
var updated = Builders<T>.Update.Set(field, value); |
|
|
|
UpdateResult result = collection.UpdateOneAsync(filter, updated).Result; |
|
|
|
} |
|
|
@@ -115,13 +115,13 @@ namespace DataVAPI.ServerDB.MongoDB |
|
|
|
old.State = "y"; |
|
|
|
old.UpdateTime = DateTime.Now;//.ToString("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
var filter = Builders<T>.Filter.Eq("IdStr", entity.Id); |
|
|
|
var filter = Builders<T>.Filter.Eq("Id", entity.Id); |
|
|
|
ReplaceOneResult result = collection.ReplaceOneAsync(filter, old).Result; |
|
|
|
} |
|
|
|
|
|
|
|
public void Delete(string id) |
|
|
|
{ |
|
|
|
var filter = Builders<T>.Filter.Eq("IdStr",id); |
|
|
|
var filter = Builders<T>.Filter.Eq("Id", id); |
|
|
|
collection.DeleteOneAsync(filter); |
|
|
|
} |
|
|
|
|
|
|
|