public void Set(ProviderSettingsType type, double value) { var doc = new BsonDocument { ["_id"] = (int)type, ["value"] = value }; _collection.Upsert(doc); }
public decimal GetAsDecimal(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsDecimal : default(decimal)); }
public byte[] GetAsBinary(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsBinary : default(byte[])); }
public DateTime GetAsDateTime(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsDateTime : default(DateTime)); }
public bool GetAsBoolean(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null && data["value"].AsBoolean); }
public string GetAsString(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsString : default(string)); }
public long GetAsInt64(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsInt64 : default(long)); }
public int GetAsInt32(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsInt32 : default(int)); }
public Guid GetAsGuid(ProviderSettingsType type) { var data = _collection.FindById((int)type); return(data != null ? data["value"].AsGuid : default(Guid)); }