Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.

Commit 259f9c5

Browse files
committed
Dev -> Trunk
1 parent 835af6f commit 259f9c5

File tree

10 files changed

+56
-19
lines changed

10 files changed

+56
-19
lines changed

MongoRepository/trunk/Help/MongoRepository.shfbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<SccProvider>SAK</SccProvider>
3838
<SccAuxPath>SAK</SccAuxPath>
3939
<SccLocalPath>SAK</SccLocalPath>
40-
<HelpFileVersion>1.6.5.0</HelpFileVersion>
40+
<HelpFileVersion>1.6.7.0</HelpFileVersion>
4141
<BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
4242
<HelpFileFormat>HtmlHelp1, Website</HelpFileFormat>
4343
<IndentHtml>False</IndentHtml>

MongoRepository/trunk/MongoRepository.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
44
<id>MongoRepository</id>
55
<title>MongoRepository</title>
6-
<version>1.6.5</version>
6+
<version>1.6.7</version>
77
<authors>tgeek, RobIII</authors>
88
<owners>tgeek</owners>
99
<licenseUrl>http://mongorepository.codeplex.com/license</licenseUrl>
@@ -13,14 +13,14 @@
1313
<tags>mongo mongodb repository</tags>
1414
<iconUrl>http://download-codeplex.sec.s-msft.com/Download?ProjectName=mongorepository&amp;DownloadId=334950&amp;Build=19692</iconUrl>
1515
<releaseNotes>
16-
Updated to MongoCSharp driver 1.9.1.221, added GetById(ObjectId) overload, added CollectionName property (convenience property)
16+
* Fix inherited classes go to same collection as baseclass (https://mongorepository.codeplex.com/discussions/572382)
1717
</releaseNotes>
1818
<summary>
1919
Provides a repository pattern on top of 10gen's MongoDB C# driver.
2020
</summary>
2121
<language>en-US</language>
2222
<dependencies>
23-
<dependency id="mongocsharpdriver" version="[1.9.1]" />
23+
<dependency id="mongocsharpdriver" version="[1.9.2]" />
2424
</dependencies>
2525
</metadata>
2626
<files>

MongoRepository/trunk/MongoRepository/MongoRepository.Net35.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
<DocumentationFile>bin\Release\MongoRepository.Net35.xml</DocumentationFile>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="MongoDB.Bson, Version=1.9.1.221, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
43+
<Reference Include="MongoDB.Bson, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
4444
<SpecificVersion>False</SpecificVersion>
45-
<HintPath>..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Bson.dll</HintPath>
45+
<HintPath>..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Bson.dll</HintPath>
4646
</Reference>
47-
<Reference Include="MongoDB.Driver, Version=1.9.1.221, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
47+
<Reference Include="MongoDB.Driver, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
4848
<SpecificVersion>False</SpecificVersion>
49-
<HintPath>..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Driver.dll</HintPath>
49+
<HintPath>..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Driver.dll</HintPath>
5050
</Reference>
5151
<Reference Include="System" />
5252
<Reference Include="System.Configuration" />

MongoRepository/trunk/MongoRepository/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
2323
[assembly: Guid("7e3d1784-b1f3-4b33-a303-7facc780917e")]
2424

25-
[assembly: AssemblyVersion("1.6.4.0")]
26-
[assembly: AssemblyFileVersion("1.6.4.0")]
25+
[assembly: AssemblyVersion("1.6.7.0")]
26+
[assembly: AssemblyFileVersion("1.6.7.0")]

MongoRepository/trunk/MongoRepository/Repository/MongoRepository.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ public MongoCollection<T> Collection
8484
get { return this.collection; }
8585
}
8686

87+
/// <summary>
88+
/// Gets the name of the collection
89+
/// </summary>
8790
public string CollectionName
8891
{
8992
get { return this.collection.Name; }

MongoRepository/trunk/MongoRepository/Util.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static string GetCollectionNameFromType(Type entitytype)
153153
}
154154
else
155155
{
156-
if (entitytype.Equals(typeof(Entity)))
156+
if (typeof(Entity).IsAssignableFrom(entitytype))
157157
{
158158
// No attribute found, get the basetype
159159
while (!entitytype.BaseType.Equals(typeof(Entity)))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="mongocsharpdriver" version="1.9.1" targetFramework="net35" />
3+
<package id="mongocsharpdriver" version="1.9.2" targetFramework="net35" />
44
</packages>

MongoRepository/trunk/MongoRepositoryTests/MongoRepositoryTests.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
<ItemGroup>
4242
<Reference Include="Microsoft.CSharp" />
4343
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
44-
<Reference Include="MongoDB.Bson, Version=1.9.1.221, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
44+
<Reference Include="MongoDB.Bson, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
4545
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Bson.dll</HintPath>
46+
<HintPath>..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Bson.dll</HintPath>
4747
</Reference>
48-
<Reference Include="MongoDB.Driver, Version=1.9.1.221, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
48+
<Reference Include="MongoDB.Driver, Version=1.9.2.235, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
4949
<SpecificVersion>False</SpecificVersion>
50-
<HintPath>..\packages\mongocsharpdriver.1.9.1\lib\net35\MongoDB.Driver.dll</HintPath>
50+
<HintPath>..\packages\mongocsharpdriver.1.9.2\lib\net35\MongoDB.Driver.dll</HintPath>
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Configuration" />
@@ -72,7 +72,9 @@
7272
</ItemGroup>
7373
<ItemGroup>
7474
<None Include="App.config" />
75-
<None Include="packages.config" />
75+
<None Include="packages.config">
76+
<SubType>Designer</SubType>
77+
</None>
7678
</ItemGroup>
7779
<ItemGroup>
7880
<ProjectReference Include="..\MongoRepository\MongoRepository.Net40.csproj">

MongoRepository/trunk/MongoRepositoryTests/RepoTests.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,45 @@ public abstract class BaseA : BaseItem
338338

339339
public class SpecialA : BaseA
340340
{ }
341-
341+
342342
[TestMethod]
343343
public void Discussion433878()
344344
{
345345
var specialRepository = new MongoRepository<SpecialA>();
346346
}
347347
#endregion
348348

349+
#region Reproduce issue: https://mongorepository.codeplex.com/discussions/572382
350+
public abstract class ClassA : Entity
351+
{
352+
public string Prop1 { get; set; }
353+
}
354+
355+
public class ClassB : ClassA
356+
{
357+
public string Prop2 { get; set; }
358+
}
359+
360+
public class ClassC : ClassA
361+
{
362+
public string Prop3 { get; set; }
363+
}
364+
365+
[TestMethod]
366+
public void Discussion572382()
367+
{
368+
var repo = new MongoRepository<ClassA>() {
369+
new ClassB() { Prop1 = "A", Prop2 = "B" } ,
370+
new ClassC() { Prop1 = "A", Prop3 = "C" }
371+
};
372+
373+
Assert.AreEqual(2, repo.Count());
374+
375+
Assert.AreEqual(2, repo.OfType<ClassA>().Count());
376+
Assert.AreEqual(1, repo.OfType<ClassB>().Count());
377+
Assert.AreEqual(1, repo.OfType<ClassC>().Count());
378+
}
379+
#endregion
380+
349381
}
350382
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="mongocsharpdriver" version="1.9.1" targetFramework="net40" />
3+
<package id="mongocsharpdriver" version="1.9.2" targetFramework="net40" />
44
</packages>

0 commit comments

Comments
 (0)