Permalink
Browse files

Mark ICursor and IMongoCollection as Obsolete.

  • Loading branch information...
lanwin committed Jun 12, 2010
1 parent ff2f0dd commit 80c4d55ad4bfc1e3162eda4d57e35c617e53ab15
View
@@ -14,7 +14,7 @@ namespace Simple
/// </summary>
internal class MainClass
{
- private IMongoCollection categories;
+ private IMongoCollection<Document> categories;
private Mongo mongo;
private IMongoDatabase simple;
@@ -36,7 +36,7 @@ public void Setup()
mongo = new Mongo(connstr);
mongo.Connect();
simple = mongo["simple"];
- categories = simple["categories"];
+ categories = simple.GetCollection<Document>("categories");
Clean();
var names = new[] {"Bluez", "Jazz", "Classical", "Rock", "Oldies", "Heavy Metal"};
@@ -17,7 +17,7 @@ Namespace Simple
Public Class Application
Private mongo as Mongo
Private simple as IMongoDatabase
- Private categories as IMongoCollection
+ Private categories As IMongoCollection(Of Document)
Public Shared Sub Main()
Dim app As New Application()
@@ -37,7 +37,7 @@ Namespace Simple
mongo = new Mongo(connstr)
mongo.Connect()
simple = mongo("simple")
- categories = simple("categories")
+ categories = simple.GetCollection(Of Document)("categories")
Clean()
Dim names() As String = {"Bluez", "Jazz", "Classical", "Rock", "Oldies", "Heavy Metal"}
@@ -78,7 +78,7 @@ Namespace Simple
'Find(new Document()) is equivalent to FindAll()
'Specifying the cursor in a using block will close it on the server if we decide not
'to iterate through the whole thing.
- Dim all As ICursor = categories.Find(New Document())
+ Dim all As ICursor(Of Document) = categories.Find(New Document())
Try
For Each doc As Document In all.Documents
Console.WriteLine(doc.ToString())
@@ -45,8 +45,7 @@
<RegisterForComInterop>false</RegisterForComInterop>
<DocumentationFile>bin\Debug\MongoDB.GridFS.xml</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <NoWarn>
- </NoWarn>
+ <NoWarn>0618</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@@ -53,6 +53,7 @@
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis>
+ <NoWarn>0618</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
@@ -5,6 +5,7 @@ namespace MongoDB {
/// <summary>
///
/// </summary>
+ [Obsolete("Uses ICursor<Document> instead. This class will be possible not included in future releases.")]
public interface ICursor : IDisposable
{
/// <summary>
@@ -5,6 +5,7 @@ namespace MongoDB
{
/// <summary>
/// </summary>
+ [Obsolete("Uses IMongoCollection<Document> instead. This class will be possible not included in future releases.")]
public interface IMongoCollection
{
/// <summary>
Oops, something went wrong.

0 comments on commit 80c4d55

Please sign in to comment.