diff --git a/NzbDrone.Services/NzbDrone.Services.Service/App_Start/NinjectMVC3.cs b/NzbDrone.Services/NzbDrone.Services.Service/App_Start/NinjectMVC3.cs index ce3c67177..abd0115c0 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/App_Start/NinjectMVC3.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/App_Start/NinjectMVC3.cs @@ -1,8 +1,7 @@ -using MongoDB.Driver; -using NzbDrone.Services.Service.Datastore; using Microsoft.Web.Infrastructure.DynamicModuleHelper; using Ninject; using Ninject.Web.Mvc; +using NzbDrone.Services.Service.Datastore; using NzbDrone.Services.Service.Migrations; using Services.PetaPoco; @@ -33,8 +32,6 @@ namespace NzbDrone.Services.Service.App_Start var kernel = new StandardKernel(); MigrationsHelper.Run(Connection.GetConnectionString); kernel.Bind().ToMethod(c => Connection.GetPetaPocoDb()); - kernel.Bind().ToConstant(Connection.GetMongoDb()); - return kernel; } diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs index c4d4010a2..abb6c05bd 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/ExceptionController.cs @@ -1,153 +1,24 @@ -using System; -using System.Linq; +using System.Linq; using System.Web.Mvc; -using MongoDB.Driver; -using NLog; -using Ninject; using NzbDrone.Common.Contract; -using NzbDrone.Services.Service.Exceptions; -using NzbDrone.Services.Service.Repository.Reporting; -using Services.PetaPoco; -using ExceptionInstance = NzbDrone.Services.Service.Repository.Reporting.ExceptionInstance; -using ExceptionReport = NzbDrone.Common.Contract.ExceptionReport; namespace NzbDrone.Services.Service.Controllers { public class ExceptionController : Controller { - private readonly IDatabase _database; - private readonly ExceptionRepository _exceptionRepository; - private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - - [Inject] - public ExceptionController(IDatabase database, ExceptionRepository exceptionRepository) - { - _database = database; - _exceptionRepository = exceptionRepository; - } [HttpPost] public EmptyResult ReportExisting(ExistingExceptionReport existingExceptionReport) { - try - { - if (ExceptionHashExists(existingExceptionReport.Hash)) - { - - var exceptionInstance = new ExceptionInstance - { - ExceptionHash = existingExceptionReport.Hash, - IsProduction = existingExceptionReport.IsProduction, - LogMessage = existingExceptionReport.LogMessage, - UGuid = existingExceptionReport.UGuid, - Timestamp = DateTime.Now - }; - - _database.Insert(exceptionInstance); - } - else - { - logger.Warn("Invalid exception hash '{0}'", existingExceptionReport.Hash); - } - } - catch (Exception e) - { - logger.FatalException("Error has occurred while saving exception", e); - throw; - } - return new EmptyResult(); } [HttpPost] public JsonResult ReportNew(ExceptionReport exceptionReport) { - try - { - - var report = new Exceptions.ExceptionReport(); - report.AppVersion = exceptionReport.Version; - report.ApplicationId = "NzbDrone"; - report.ExceptionMessage = exceptionReport.ExceptionMessage; - report.ExceptionType = exceptionReport.Type; - report.Location = exceptionReport.Logger; - report.Message = exceptionReport.LogMessage; - report.Stack = exceptionReport.Stack; - report.Uid = exceptionReport.UGuid.ToString(); - - _exceptionRepository.Store(report); - - var exceptionHash = GetExceptionDetailId(exceptionReport); - - var exceptionInstance = new ExceptionInstance - { - ExceptionHash = exceptionHash, - IsProduction = exceptionReport.IsProduction, - LogMessage = exceptionReport.LogMessage, - Timestamp = DateTime.Now, - UGuid = exceptionReport.UGuid - }; - - _database.Insert(exceptionInstance); - - return new JsonResult { Data = new ExceptionReportResponse { ExceptionHash = exceptionHash } }; - } - catch (Exception e) - { - logger.FatalException("Error has occurred while saving exception", e); - if (!exceptionReport.IsProduction) - { - throw; - } - } - return new JsonResult(); } - private string GetExceptionDetailId(ExceptionReport exceptionReport) - { - var reportHash = Hash(String.Concat(exceptionReport.Version, exceptionReport.String, exceptionReport.Logger)); - - if (!ExceptionHashExists(reportHash)) - { - var exeptionDetail = new ExceptionDetail(); - exeptionDetail.Hash = reportHash; - exeptionDetail.Logger = exceptionReport.Logger; - exeptionDetail.String = exceptionReport.String; - exeptionDetail.Type = exceptionReport.Type; - exeptionDetail.Version = exceptionReport.Version; - - _database.Insert(exeptionDetail); - } - - return reportHash; - } - - private bool ExceptionHashExists(string reportHash) - { - return _database.Exists(reportHash); - } - - private static string Hash(string input) - { - uint mCrc = 0xffffffff; - byte[] bytes = System.Text.Encoding.UTF8.GetBytes(input); - foreach (byte myByte in bytes) - { - mCrc ^= ((uint)(myByte) << 24); - for (var i = 0; i < 8; i++) - { - if ((Convert.ToUInt32(mCrc) & 0x80000000) == 0x80000000) - { - mCrc = (mCrc << 1) ^ 0x04C11DB7; - } - else - { - mCrc <<= 1; - } - } - } - return String.Format("{0:x8}", mCrc); - } + } } \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Datastore/Connection.cs b/NzbDrone.Services/NzbDrone.Services.Service/Datastore/Connection.cs index 0e934eb6a..665698b90 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Datastore/Connection.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Datastore/Connection.cs @@ -1,9 +1,5 @@ -using System; -using System.Configuration; +using System.Configuration; using System.Linq; -using MongoDB.Bson; -using MongoDB.Driver; -using NzbDrone.Services.Service.Migrations; using Services.PetaPoco; @@ -28,22 +24,6 @@ namespace NzbDrone.Services.Service.Datastore } - public static MongoDatabase GetMongoDb() - { - var serverSettings = new MongoServerSettings() - { - ConnectionMode = ConnectionMode.Direct, - ConnectTimeout = TimeSpan.FromSeconds(10), - DefaultCredentials = new MongoCredentials("nzbdrone", "nzbdronepassword"), - GuidRepresentation = GuidRepresentation.Standard, - Server = new MongoServerAddress("ds031747.mongolab.com", 31747), - SafeMode = new SafeMode(true) { J = true }, - }; - - - var server = MongoServer.Create(serverSettings); - - return server.GetDatabase("nzbdrone_ex"); - } + } } \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionInfo.cs b/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionInfo.cs deleted file mode 100644 index 97f6eae22..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Linq; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; - -namespace NzbDrone.Services.Service.Exceptions -{ - public class ExceptionInfo - { - public ExceptionInfo() - { - Instances = new ExceptionInstance[0]; - } - - [BsonId] - public string Hash { get; set; } - - [BsonElement("xtype")] - public string ExceptionType { get; set; } - - [BsonElement("stk")] - public string Stack { get; set; } - - [BsonElement("loc")] - public string Location { get; set; } - - [BsonElement("inst")] - public IEnumerable Instances { get; set; } - } -} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionInstance.cs b/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionInstance.cs deleted file mode 100644 index 1db23a353..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionInstance.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Linq; -using System; -using MongoDB.Bson.Serialization.Attributes; - -namespace NzbDrone.Services.Service.Exceptions -{ - public class ExceptionInstance - { - [BsonElement("ver")] - public string AppVersion { get; set; } - - [BsonElement("uid")] - public string UserId { get; set; } - - [BsonElement("xmsg")] - public string ExceptionMessage { get; set; } - - [BsonElement("msg")] - public string Message { get; set; } - - [BsonElement("time")] - public DateTime Time { get; set; } - } -} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionReport.cs b/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionReport.cs deleted file mode 100644 index 7988ae9a9..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionReport.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Linq; - -namespace NzbDrone.Services.Service.Exceptions -{ - public class ExceptionReport - { - public string ApplicationId { get; set; } - public string AppVersion { get; set; } - public string Uid { get; set; } - public string ExceptionType { get; set; } - public string ExceptionMessage { get; set; } - public string Stack { get; set; } - public string Location { get; set; } - public string Message { get; set; } - } -} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs b/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs deleted file mode 100644 index e551cebff..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Exceptions/ExceptionRepository.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Linq; -using MongoDB.Driver; -using MongoDB.Driver.Builders; - -namespace NzbDrone.Services.Service.Exceptions -{ - public class ExceptionRepository - { - private readonly MongoDatabase _mongoDb; - - public ExceptionRepository(MongoDatabase mongoDb) - { - _mongoDb = mongoDb; - } - - public ExceptionRepository() - { - - } - - public virtual string Store(NzbDrone.Services.Service.Exceptions.ExceptionReport exceptionReport) - { - var hash = GetExceptionDetailId(exceptionReport); - - var exceptionInstance = new NzbDrone.Services.Service.Exceptions.ExceptionInstance - { - AppVersion = exceptionReport.AppVersion, - ExceptionMessage = exceptionReport.ExceptionMessage, - Message = exceptionReport.Message, - Time = DateTime.UtcNow, - UserId = exceptionReport.Uid - }; - - - - var applicationExceptions = _mongoDb.GetCollection(exceptionReport.ApplicationId); - - applicationExceptions.Update(Query.EQ("_id", hash), Update.PushWrapped("inst", exceptionInstance)); - - return hash; - } - - private string GetExceptionDetailId(NzbDrone.Services.Service.Exceptions.ExceptionReport exceptionReport) - { - var hash = Hash(String.Concat(exceptionReport.AppVersion, exceptionReport.Location, exceptionReport.ExceptionType, exceptionReport.Stack)); - - if (!ExceptionInfoExists(exceptionReport.ApplicationId, hash)) - { - var exceptionInfo = new NzbDrone.Services.Service.Exceptions.ExceptionInfo - { - Hash = hash, - Stack = exceptionReport.Stack, - ExceptionType = exceptionReport.ExceptionType, - Location = exceptionReport.Location - }; - - _mongoDb.GetCollection(exceptionReport.ApplicationId).Insert(exceptionInfo); - } - - return hash; - } - - public bool ExceptionInfoExists(string applicationId, string hash) - { - var appCollection = _mongoDb.GetCollection(applicationId); - return appCollection.FindAs(Query.EQ("_id", hash)).Any(); - } - - private static string Hash(string input) - { - uint mCrc = 0xffffffff; - byte[] bytes = System.Text.Encoding.UTF8.GetBytes(input); - foreach (byte myByte in bytes) - { - mCrc ^= ((uint)(myByte) << 24); - for (var i = 0; i < 8; i++) - { - if ((Convert.ToUInt32(mCrc) & 0x80000000) == 0x80000000) - { - mCrc = (mCrc << 1) ^ 0x04C11DB7; - } - else - { - mCrc <<= 1; - } - } - } - return String.Format("{0:x8}", mCrc); - } - } -} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj b/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj index 00ec87034..3dbac8649 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj +++ b/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj @@ -41,9 +41,6 @@ x86 - - ..\..\packages\AutoMapper.2.0.0\lib\net40-client\AutoMapper.dll - ..\..\packages\elmah.corelibrary.1.2.1\lib\Elmah.dll @@ -64,12 +61,6 @@ False ..\..\Libraries\Migrator.NET\Migrator.Providers.dll - - ..\..\packages\mongocsharpdriver.1.4\lib\net35\MongoDB.Bson.dll - - - ..\..\packages\mongocsharpdriver.1.4\lib\net35\MongoDB.Driver.dll - ..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll @@ -100,8 +91,6 @@ True - - @@ -222,15 +211,9 @@ - - - - - - @@ -252,7 +235,6 @@ - diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionDetail.cs b/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionDetail.cs deleted file mode 100644 index b35821fd0..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionDetail.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Linq; -using Services.PetaPoco; - -namespace NzbDrone.Services.Service.Repository.Reporting -{ - [TableName("Exceptions")] - [PrimaryKey("Hash", autoIncrement = false)] - public class ExceptionDetail - { - public string Hash { get; set; } - public string Logger { get; set; } - public string Type { get; set; } - public string String { get; set; } - public string Version { get; set; } - } -} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionInstance.cs b/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionInstance.cs deleted file mode 100644 index 083243370..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionInstance.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Linq; -using Services.PetaPoco; - -namespace NzbDrone.Services.Service.Repository.Reporting -{ - [TableName("ExceptionInstances")] - public class ExceptionInstance - { - public long Id { get; set; } - public string ExceptionHash { get; set; } - public string LogMessage { get; set; } - public DateTime Timestamp { get; set; } - public bool IsProduction { get; set; } - public Guid UGuid { get; set; } - } -} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionRow.cs b/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionRow.cs deleted file mode 100644 index 27b99b200..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Service/Repository/Reporting/ExceptionRow.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Linq; -using Services.PetaPoco; - -namespace NzbDrone.Services.Service.Repository.Reporting -{ - [TableName("ExceptionReports")] - public class ExceptionRow : ReportRowBase - { - public string Type { get; set; } - public string Logger { get; set; } - public string LogMessage { get; set; } - public string String { get; set; } - } -} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/packages.config b/NzbDrone.Services/NzbDrone.Services.Service/packages.config index ce919f82c..8c2b16215 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/packages.config +++ b/NzbDrone.Services/NzbDrone.Services.Service/packages.config @@ -1,6 +1,5 @@  - @@ -9,7 +8,6 @@ - diff --git a/NzbDrone.Services/NzbDrone.Services.Tests/ExceptionControllerTests/ReportExistingFixture.cs b/NzbDrone.Services/NzbDrone.Services.Tests/ExceptionControllerTests/ReportExistingFixture.cs deleted file mode 100644 index 87cdd26c2..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Tests/ExceptionControllerTests/ReportExistingFixture.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Linq; -using FizzWare.NBuilder; -using FluentAssertions; -using NUnit.Framework; -using NzbDrone.Common.Contract; -using NzbDrone.Services.Service.Repository.Reporting; -using NzbDrone.Services.Tests.Framework; -using NzbDrone.Test.Common; - -namespace NzbDrone.Services.Tests.ExceptionControllerTests -{ - [TestFixture] - public class ReportExistingFixture : ServicesTestBase - { - - Service.Controllers.ExceptionController Controller - { - get - { - return Mocker.Resolve(); - } - } - - private static ExistingExceptionReport CreateExceptionReport() - { - return new ExistingExceptionReport - { - IsProduction = true, - Version = "1.1.2.323456", - UGuid = Guid.NewGuid(), - LogMessage = @"Log message", - Hash = "ABC123" - }; - } - - [Test] - public void should_log_warn_if_hash_doesnt_exist() - { - WithRealDb(); - - Controller.ReportExisting(CreateExceptionReport()); - - Db.Fetch().Should().BeEmpty(); - Db.Fetch().Should().BeEmpty(); - - ExceptionVerification.ExpectedWarns(1); - } - - [Test] - public void should_save_instance_if_hash_is_valid() - { - WithRealDb(); - - var existing = CreateExceptionReport(); - - - Db.Insert(Builder.CreateNew().With(c => c.Hash = existing.Hash).Build()); - - Controller.ReportExisting(existing); - - Db.Fetch().Should().HaveCount(1); - var exceptionInstance = Db.Fetch(); - exceptionInstance.Should().HaveCount(1); - exceptionInstance.Single().Id.Should().BeGreaterThan(0); - exceptionInstance.Single().ExceptionHash.Should().NotBeBlank(); - exceptionInstance.Single().IsProduction.Should().Be(existing.IsProduction); - exceptionInstance.Single().Timestamp.Should().BeWithin(TimeSpan.FromSeconds(4)).Before(DateTime.Now); - exceptionInstance.Single().LogMessage.Should().Be(existing.LogMessage); - exceptionInstance.Single().UGuid.Should().Be(existing.UGuid); - } - - } -} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Tests/ExceptionControllerTests/ReportNewFixture.cs b/NzbDrone.Services/NzbDrone.Services.Tests/ExceptionControllerTests/ReportNewFixture.cs deleted file mode 100644 index 2e96d18b4..000000000 --- a/NzbDrone.Services/NzbDrone.Services.Tests/ExceptionControllerTests/ReportNewFixture.cs +++ /dev/null @@ -1,213 +0,0 @@ -using System; -using System.Linq; -using FluentAssertions; -using NUnit.Framework; -using NzbDrone.Common.Contract; -using NzbDrone.Services.Service.Repository.Reporting; -using NzbDrone.Services.Tests.Framework; - -namespace NzbDrone.Services.Tests.ExceptionControllerTests -{ - [TestFixture] - public class ReportNewFixture : ServicesTestBase - { - - Service.Controllers.ExceptionController Controller - { - get - { - return Mocker.Resolve(); - } - } - - private static ExceptionReport CreateExceptionReport() - { - return new ExceptionReport - { - IsProduction = true, - Version = "1.1.2.323456", - UGuid = Guid.NewGuid(), - Logger = "NzbDrone.Logger.Name", - LogMessage = @"Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message", - String = @"Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message - Long message Long message Long messageLong messageLong messageLong messageLong messageLong messageLong messageLong messageLong message", - - Type = typeof(InvalidOperationException).Name - }; - } - - - [Test] - public void ReportNew_should_save_instance() - { - var exceptionReport = CreateExceptionReport(); - - WithRealDb(); - - Controller.ReportNew(exceptionReport); - - var exceptionInstance = Db.Fetch(); - exceptionInstance.Should().HaveCount(1); - exceptionInstance.Single().Id.Should().BeGreaterThan(0); - exceptionInstance.Single().ExceptionHash.Should().NotBeBlank(); - exceptionInstance.Single().IsProduction.Should().Be(exceptionReport.IsProduction); - exceptionInstance.Single().Timestamp.Should().BeWithin(TimeSpan.FromSeconds(4)).Before(DateTime.Now); - exceptionInstance.Single().LogMessage.Should().Be(exceptionReport.LogMessage); - exceptionInstance.Single().UGuid.Should().Be(exceptionReport.UGuid); - } - - [Test] - public void ReportNew_should_save_detail() - { - var exceptionReport = CreateExceptionReport(); - - WithRealDb(); - - Controller.ReportNew(exceptionReport); - - var exceptionDetails = Db.Fetch(); - exceptionDetails.Should().HaveCount(1); - exceptionDetails.Single().Hash.Should().NotBeBlank(); - exceptionDetails.Single().Logger.Should().Be(exceptionReport.Logger); - exceptionDetails.Single().Type.Should().Be(exceptionReport.Type); - exceptionDetails.Single().String.Should().Be(exceptionReport.String); - exceptionDetails.Single().Version.Should().Be(exceptionReport.Version); - } - - [Test] - public void ReportNew_should_return_exception_id() - { - var exceptionReport = CreateExceptionReport(); - - WithRealDb(); - - var response = Controller.ReportNew(exceptionReport); - - response.Data.Should().BeOfType(); - ((ExceptionReportResponse)response.Data).ExceptionHash.Should().NotBeBlank(); - } - - - [Test] - public void Reporting_exception_more_than_once_should_create_single_detail_with_multiple_instances() - { - var exceptionReport = CreateExceptionReport(); - - WithRealDb(); - - var response1 = Controller.ReportNew(exceptionReport); - var response2 = Controller.ReportNew(exceptionReport); - var response3 = Controller.ReportNew(exceptionReport); - - var detail = Db.Fetch(); - var instances = Db.Fetch(); - - detail.Should().HaveCount(1); - instances.Should().HaveCount(3); - - instances.Should().OnlyContain(c => c.ExceptionHash == detail.Single().Hash); - } - - [Test] - public void Reporting_exception_with_diffrent_version_should_create_new_detail() - { - var exceptionReport1 = CreateExceptionReport(); - exceptionReport1.Version = "0.1.1"; - - var exceptionReport2 = CreateExceptionReport(); - exceptionReport2.Version = "0.2.1"; - - WithRealDb(); - - Controller.ReportNew(exceptionReport1); - Controller.ReportNew(exceptionReport2); - - var detail = Db.Fetch(); - var instances = Db.Fetch(); - - detail.Should().HaveCount(2); - instances.Should().HaveCount(2); - } - - [Test] - public void Reporting_exception_with_diffrent_strting_should_create_new_detail() - { - var exceptionReport1 = CreateExceptionReport(); - exceptionReport1.String = "Error1"; - - var exceptionReport2 = CreateExceptionReport(); - exceptionReport2.String = "Error2"; - - WithRealDb(); - - Controller.ReportNew(exceptionReport1); - Controller.ReportNew(exceptionReport2); - - var detail = Db.Fetch(); - var instances = Db.Fetch(); - - detail.Should().HaveCount(2); - instances.Should().HaveCount(2); - } - - [Test] - public void Reporting_exception_with_diffrent_logger_should_create_new_detail() - { - var exceptionReport1 = CreateExceptionReport(); - exceptionReport1.Logger = "logger1"; - - var exceptionReport2 = CreateExceptionReport(); - exceptionReport2.Logger = "logger2"; - - WithRealDb(); - - Controller.ReportNew(exceptionReport1); - Controller.ReportNew(exceptionReport2); - - var detail = Db.Fetch(); - var instances = Db.Fetch(); - - detail.Should().HaveCount(2); - instances.Should().HaveCount(2); - } - } -} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Tests/NzbDrone.Services.Tests.csproj b/NzbDrone.Services/NzbDrone.Services.Tests/NzbDrone.Services.Tests.csproj index 7f757d47d..1614890ce 100644 --- a/NzbDrone.Services/NzbDrone.Services.Tests/NzbDrone.Services.Tests.csproj +++ b/NzbDrone.Services/NzbDrone.Services.Tests/NzbDrone.Services.Tests.csproj @@ -68,8 +68,6 @@ - - diff --git a/packages/AutoMapper.2.0.0/AutoMapper.2.0.0.nupkg b/packages/AutoMapper.2.0.0/AutoMapper.2.0.0.nupkg deleted file mode 100644 index afe24aa14..000000000 Binary files a/packages/AutoMapper.2.0.0/AutoMapper.2.0.0.nupkg and /dev/null differ diff --git a/packages/AutoMapper.2.0.0/lib/net40-client/AutoMapper.dll b/packages/AutoMapper.2.0.0/lib/net40-client/AutoMapper.dll deleted file mode 100644 index 2e6c45f1b..000000000 Binary files a/packages/AutoMapper.2.0.0/lib/net40-client/AutoMapper.dll and /dev/null differ diff --git a/packages/AutoMapper.2.0.0/lib/net40-client/AutoMapper.xml b/packages/AutoMapper.2.0.0/lib/net40-client/AutoMapper.xml deleted file mode 100644 index a5c98208f..000000000 --- a/packages/AutoMapper.2.0.0/lib/net40-client/AutoMapper.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - AutoMapper - - - - - This expression visitor will replace an input parameter by another one - - see http://stackoverflow.com/questions/4601844/expression-tree-copy-or-convert - - - - diff --git a/packages/AutoMapper.2.0.0/lib/sl4/AutoMapper.XML b/packages/AutoMapper.2.0.0/lib/sl4/AutoMapper.XML deleted file mode 100644 index 3b6bdccba..000000000 --- a/packages/AutoMapper.2.0.0/lib/sl4/AutoMapper.XML +++ /dev/null @@ -1,671 +0,0 @@ - - - - AutoMapper - - - - - This expression visitor will replace an input parameter by another one - - see http://stackoverflow.com/questions/4601844/expression-tree-copy-or-convert - - - - - Search key structure for - - Type of the key. - Type of the value. - - - - A Concurrent implementation. - - Type of the keys. - Type of the values. - - This class is threadsafe and highly concurrent. This means that multiple threads can do lookup and insert operations - on this dictionary simultaneously. - It is not guaranteed that collisions will not occur. The dictionary is partitioned in segments. A segment contains - a set of items based on a hash of those items. The more segments there are and the beter the hash, the fewer collisions will occur. - This means that a nearly empty ConcurrentDictionary is not as concurrent as one containing many items. - - - - - Base class for concurrent hashtable implementations - - Type of the items stored in the hashtable. - Type of the key to search with. - - - - Constructor (protected) - - Use Initialize method after construction. - - - - Initialize the newly created ConcurrentHashtable. Invoke in final (sealed) constructor - or Create method. - - - - - Create a segment range - - Number of segments in range. - Number of slots allocated initialy in each segment. - The created instance. - - - - While adjusting the segmentation, _NewRange will hold a reference to the new range of segments. - when the adjustment is complete this reference will be copied to _CurrentRange. - - - - - Will hold the most current reange of segments. When busy adjusting the segmentation, this - field will hold a reference to the old range. - - - - - While adjusting the segmentation this field will hold a boundary. - Clients accessing items with a key hash value below this boundary (unsigned compared) - will access _NewRange. The others will access _CurrentRange - - - - - Get a hashcode for given storeable item. - - Reference to the item to get a hash value for. - The hash value as an . - - The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough. - A storeable item and a matching search key should return the same hash code. - So the statement ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true; - - - - - Get a hashcode for given search key. - - Reference to the key to get a hash value for. - The hash value as an . - - The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough. - A storeable item and a matching search key should return the same hash code. - So the statement ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true; - - - - - Compares a storeable item to a search key. Should return true if they match. - - Reference to the storeable item to compare. - Reference to the search key to compare. - True if the storeable item and search key match; false otherwise. - - - - Compares two storeable items for equality. - - Reference to the first storeable item to compare. - Reference to the second storeable item to compare. - True if the two soreable items should be regarded as equal. - - - - Indicates if a specific item reference contains a valid item. - - The storeable item reference to check. - True if the reference doesn't refer to a valid item; false otherwise. - The statement IsEmpty(default(TStoredI)) should always be true. - - - - Returns the type of the key value or object. - - The stored item to get the type of the key for. - The actual type of the key or null if it can not be determined. - - Used for diagnostics purposes. - - - - - Gets a segment out of either _NewRange or _CurrentRange based on the hash value. - - - - - - - Gets a LOCKED segment out of either _NewRange or _CurrentRange based on the hash value. - Unlock needs to be called on this segment before it can be used by other clients. - - - - - - - Gets a LOCKED segment out of either _NewRange or _CurrentRange based on the hash value. - Unlock needs to be called on this segment before it can be used by other clients. - - - - - - - Finds an item in the table collection that maches the given searchKey - - The key to the item. - Out reference to a field that will receive the found item. - A boolean that will be true if an item has been found and false otherwise. - - - - Looks for an existing item in the table contents using an alternative copy. If it can be found it will be returned. - If not then the alternative copy will be added to the table contents and the alternative copy will be returned. - - A copy to search an already existing instance with - Out reference to receive the found item or the alternative copy - A boolean that will be true if an existing copy was found and false otherwise. - - - - Replaces and existing item - - - - - true is the existing item was successfully replaced. - - - - Inserts an item in the table contents possibly replacing an existing item. - - The item to insert in the table - Out reference to a field that will receive any possibly replaced item. - A boolean that will be true if an existing copy was found and replaced and false otherwise. - - - - Removes an item from the table contents. - - The key to find the item with. - Out reference to a field that will receive the found and removed item. - A boolean that will be rue if an item was found and removed and false otherwise. - - - - Enumerates all segments in _CurrentRange and locking them before yielding them and resleasing the lock afterwards - The order in which the segments are returned is undefined. - Lock SyncRoot before using this enumerable. - - - - - - Removes all items from the collection. - Aquires a lock on SyncRoot before it does it's thing. - When this method returns and multiple threads have access to this table it - is not guaranteed that the table is actually empty. - - - - - Determines if a segmentation adjustment is needed. - - True - - - - Bool as int (for interlocked functions) that is true if a Segmentation assesment is pending. - - - - - The total allocated number of item slots. Filled with nonempty items or not. - - - - - When a segment resizes it uses this method to inform the hashtable of the change in allocated space. - - - - - - Schedule a call to the AssessSegmentation() method. - - - - - Checks if segmentation needs to be adjusted and if so performs the adjustment. - - - - - - This method is called when a re-segmentation is expected to be needed. It checks if it actually is needed and, if so, performs the re-segementation. - - - - - Adjusts the segmentation to the new segment count - - The new number of segments to use. This must be a power of 2. - The number of item slots to reserve in each segment. - - - - Returns an object that serves as a lock for range operations - - - Clients use this primarily for enumerating over the Tables contents. - Locking doesn't guarantee that the contents don't change, but prevents operations that would - disrupt the enumeration process. - Operations that use this lock: - Count, Clear, DisposeGarbage and AssessSegmentation. - Keeping this lock will prevent the table from re-segmenting. - - - - - Gets an IEnumerable to iterate over all items in all segments. - - - - A lock should be aquired and held on SyncRoot while this IEnumerable is being used. - The order in which the items are returned is undetermined. - - - - - Returns a count of all items in teh collection. This may not be - aqurate when multiple threads are accessing this table. - Aquires a lock on SyncRoot before it does it's thing. - - - - - Gives the minimum number of segments a hashtable can contain. This should be 1 or more and always a power of 2. - - - - - Gives the minimum number of allocated item slots per segment. This should be 1 or more, always a power of 2 - and less than 1/2 of MeanSegmentAllocatedSpace. - - - - - Gives the prefered number of allocated item slots per segment. This should be 4 or more and always a power of 2. - - - - - Constructs a instance using the default to compare keys. - - - - - Constructs a instance using the specified to compare keys. - - The tp compare keys with. - is null. - - - - Get a hashcode for given storeable item. - - Reference to the item to get a hash value for. - The hash value as an . - - The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough. - A storeable item and a matching search key should return the same hash code. - So the statement ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true; - - - - - Get a hashcode for given search key. - - Reference to the key to get a hash value for. - The hash value as an . - - The hash returned should be properly randomized hash. The standard GetItemHashCode methods are usually not good enough. - A storeable item and a matching search key should return the same hash code. - So the statement ItemEqualsItem(storeableItem, searchKey) ? GetItemHashCode(storeableItem) == GetItemHashCode(searchKey) : true should always be true; - - - - - Compares a storeable item to a search key. Should return true if they match. - - Reference to the storeable item to compare. - Reference to the search key to compare. - True if the storeable item and search key match; false otherwise. - - - - Compares two storeable items for equality. - - Reference to the first storeable item to compare. - Reference to the second storeable item to compare. - True if the two soreable items should be regarded as equal. - - - - Indicates if a specific item reference contains a valid item. - - The storeable item reference to check. - True if the reference doesn't refer to a valid item; false otherwise. - The statement IsEmpty(default(TStoredI)) should always be true. - - - - Adds an element with the provided key and value to the dictionary. - - The object to use as the key of the element to add. - The object to use as the value of the element to add. - An element with the same key already exists in the dictionary. - - - - Determines whether the dictionary - contains an element with the specified key. - - The key to locate in the dictionary. - true if the dictionary contains - an element with the key; otherwise, false. - - - - Removes the element with the specified key from the dictionary. - - The key of the element to remove. - true if the element is successfully removed; otherwise, false. This method - also returns false if key was not found in the original dictionary. - - - - Gets the value associated with the specified key. - - The key whose value to get. - - When this method returns, the value associated with the specified key, if - the key is found; otherwise, the default value for the type of the value - parameter. This parameter is passed uninitialized. - - - true if the dictionary contains an element with the specified key; otherwise, false. - - - - - Adds an association to the dictionary. - - A that represents the association to add. - An association with an equal key already exists in the dicitonary. - - - - Removes all items from the dictionary. - - WHen working with multiple threads, that each can add items to this dictionary, it is not guaranteed that the dictionary will be empty when this method returns. - - - - Determines whether the specified association exists in the dictionary. - - The key-value association to search fo in the dicionary. - True if item is found in the dictionary; otherwise, false. - - This method compares both key and value. It uses the default equality comparer to compare values. - - - - - Copies all associations of the dictionary to an - , starting at a particular index. - - The one-dimensional that is the destination of the associations - copied from . The must - have zero-based indexing. - The zero-based index in at which copying begins. - is null. - is less than 0. - is equal to or greater than the length of . - The number of associations to be copied - is greater than the available space from to the end of the destination - . - - - - Removes the specified association from the , comparing both key and value. - - A representing the association to remove. - true if the association was successfully removed from the ; - otherwise, false. This method also returns false if the association is not found in - the original . - - - - - Returns an enumerator that iterates through all associations in the at the moment of invocation. - - A that can be used to iterate through the associations. - - - - Returns an enumerator that iterates through all associations in the at the moment of invocation. - - A that can be used to iterate through the associations. - - - - Gives the of TKey that is used to compare keys. - - - - - Gets an containing the keys of - the dictionary. - - An containing the keys of the dictionary. - This property takes a snapshot of the current keys collection of the dictionary at the moment of invocation. - - - - Gets an containing the values in - the dictionary. - - - An containing the values in the dictionary. - - This property takes a snapshot of the current keys collection of the dictionary at the moment of invocation. - - - - Gets or sets the value associated with the specified key. - - The key of the value to get or set. - The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNotFoundException, and a set operation creates a new element with the specified key. - - When working with multiple threads, that can each potentialy remove the searched for item, a can always be expected. - - - - - Gets the number of elements contained in the . - - - - - Gets a value indicating whether the is read-only, which is always false. - - - - - A 'single writer - multi reader' threaded segment in a hashtable. - - - - - Though each segment can be accessed by 1 writer thread simultaneously, the hashtable becomes concurrent - for writing by containing many segments so that collisions are rare. The table will be fully concurrent - for read operations as far as they are not colliding with write operations. - Each segment is itself a small hashtable that can grow and shrink individualy. This prevents blocking of - the entire hashtable when growing or shrinking is needed. Because each segment is relatively small (depending on - the quality of the hash) resizing of the individual segments should not take much time. - - - - - Initialize the segment. - - - - - - When segment gets introduced into hashtable then its allocated space should be added to the - total allocated space. - Single threaded access or locking is needed - - - - - - When segment gets removed from hashtable then its allocated space should be subtracted to the - total allocated space. - Single threaded access or locking is needed - - - - - - Array with 'slots'. Each slot can be filled or empty. - - - - - Inserts an item into a *not empty* spot given by position i. It moves items forward until an empty spot is found. - - - - - - - - - Find item in segment. - - Reference to the search key to use. - Out reference to store the found item in. - Object that tells this segment how to treat items and keys. - True if an item could be found, otherwise false. - - - - Find an existing item or, if it can't be found, insert a new item. - - Reference to the item that will be inserted if an existing item can't be found. It will also be used to search with. - Out reference to store the found item or, if it can not be found, the new inserted item. - Object that tells this segment how to treat items and keys. - True if an existing item could be found, otherwise false. - - - - Inserts an item in the segment, possibly replacing an equal existing item. - - A reference to the item to insert. - An out reference where any replaced item will be written to, if no item was replaced the new item will be written to this reference. - Object that tells this segment how to treat items and keys. - True if an existing item could be found and is replaced, otherwise false. - - - - Removes an item from the segment. - - A reference to the key to search with. - An out reference where the removed item will be stored or default() if no item to remove can be found. - Object that tells this segment how to treat items and keys. - True if an item could be found and is removed, false otherwise. - - - - Iterate over items in the segment. - - Position beyond which the next filled slot will be found and the item in that slot returned. (Starting with -1) - Out reference where the next item will be stored or default if the end of the segment is reached. - Object that tells this segment how to treat items and keys. - The index position the next item has been found or -1 otherwise. - - - - Total numer of filled slots in _List. - - - - - Remove any excess allocated space - - - - - - Boolean value indicating if this segment has not been trashed yet. - - - - - Tiny spin lock that allows multiple readers simultanously and 1 writer exclusively - - - - - Release a reader lock - - - - - Release a writer lock - - - - - Aquire a reader lock. Wait until lock is aquired. - - - - - Aquire a reader lock. - - True if to wait until lock aquired, False to return immediately. - Boolean indicating if lock was successfuly aquired. - - - - Aquire a writer lock. Wait until lock is aquired. - - - - - Aquire a writer lock. - - True if to wait until lock aquired, False to return immediately. - Boolean indicating if lock was successfuly aquired. - - - - Attempts to replicate the Desktop CLR. - - - - diff --git a/packages/AutoMapper.2.0.0/lib/sl4/AutoMapper.dll b/packages/AutoMapper.2.0.0/lib/sl4/AutoMapper.dll deleted file mode 100644 index 6921beb12..000000000 Binary files a/packages/AutoMapper.2.0.0/lib/sl4/AutoMapper.dll and /dev/null differ diff --git a/packages/mongocsharpdriver.1.4/License.rtf b/packages/mongocsharpdriver.1.4.1/License.rtf similarity index 100% rename from packages/mongocsharpdriver.1.4/License.rtf rename to packages/mongocsharpdriver.1.4.1/License.rtf diff --git a/packages/mongocsharpdriver.1.4.1/Release Notes v1.4.1.txt b/packages/mongocsharpdriver.1.4.1/Release Notes v1.4.1.txt new file mode 100644 index 000000000..894f1b1dc --- /dev/null +++ b/packages/mongocsharpdriver.1.4.1/Release Notes v1.4.1.txt @@ -0,0 +1,237 @@ +C# Driver Version 1.4.1 Release Notes +===================================== + +This minor release fixes a few issues found by users of the LINQ support added +in v1.4 of the C# driver and also adds support for a few new LINQ query +operators and where clauses. + +File by file change logs are available at: + +https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Change%20Log%20v1.4.1-Bson.txt +https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Change%20Log%20v1.4.1-Driver.txt + +These release notes describe the changes at a higher level, and omit describing +some of the minor changes. + +Breaking changes +---------------- + +There are no breaking changes in this release. + +JIRA issues resolved +-------------------- + +The full list of JIRA issues resolved in this release is available at: + +https://jira.mongodb.org/secure/IssueNavigator.jspa?mode=hide&requestId=11397 + +LINQ query support +================== + +The main purpose of this minor release is to fix some issues found by users of +the new LINQ support added in v1.4. + +One bug that many have encountered is a NullReferenceException when writing a +query against an inherited property. + +https://jira.mongodb.org/browse/CSHARP-418 + +You would hit this error if you had any queries that were similar to this: + + public class B + { + public ObjectId Id; + } + + public class C : B + { + public int X; + } + + var query = + from c in collection.AsQueryable() + where c.Id = id // class C inherits Id from class B + select c; + +Another bug that a few users have encountered is an ArgumentOutOfRangeException +when writing a LINQ query that consists of a bare AsQueryable and nothing else: + +https://jira.mongodb.org/browse/CSHARP-419 + +as in this sample: + + var query = collection.AsQueryable(); // no where clause + +Normally a query would contain something else besides the call to AsQueryable +(like a where clause), but this is a legal query and is now supported. + +BSON library changes +==================== + +MaxSerializationDepth +--------------------- + +The BSON serialization mechanism does not support circular references in your +object graph. In earlier versions of the C# driver if you attempted to +serialize an object with circular references you would get a +StackOverflowExpection. The 1.4.1 version now tracks the serialization depth +as it serializes an object and if it exceeds MaxSerializationDepth a +BsonSerializationException is thrown. The problem with StackOverflowException +was that it was fatal to your process, but the BsonSerializationException can +be caught and your process can continue executing if you choose. + +The default MaxSerializationDepth is 100. + +Interpretation of C# null vs BsonNull.Value +------------------------------------------- + +When working with the BsonDocument object model a C# null is usually ignored, +specially when creating BsonDocuments using functional construction. However, +when mapping between .NET types and the BsonDocument object model a C# null +will now be mapped to a BsonNull. For example: + + var dictionary = new Dictionary { { "x", null } }; + var document = new BsonDocument(dictionary); + // document["x"] == BsonNull.Value + +and when mapping in the reverse direction a BsonNull will map to a C# null: + + var document = new BsonDocument { { "x", BsonNull.Value } }; + var dictionary = document.ToDictionary(); + // dictionary["x"] == null + +Usually mapping between .NET types and the BsonDocument object model happens +automatically as needed, but if you want to invoke the mapping yourself you +can access the BsonTypeMapper directly: + + var dictionary = new Dictionary { { "x", null } }; + var document = BsonTypeMapper.MapToBsonValue(dictionary); + // document["x"] == BsonNull.Value + +or in the other direction: + + var document = new BsonDocument { { "x", BsonNull.Value } }; + var dictionary = (IDictionary)BsonTypeMapper.MapToDotNetValue(document); + // dictionary["x"] == null + +Serializing read-only properties +-------------------------------- + +The class map based serialization support normally serializes only public +read-write properties (or fields). Sometimes it can be useful to serialize +read-only properties as well, specially if you want to query against them. +You can now opt-in your read-only properties so that they appear in the +serialized document. For example: + + public class Book + { + public ObjectId Id; + public string Title; + [BsonElement] // opt-in the read-only LowercaseTitle property + public string LowercaseTitle { get { return Title.ToLower(); } } + } + +Now when a Book is serialized the document will look like: + + { + _id : ObjectId("4f8d771dae879111d289dbc0"), + Title : "For Whom the Bell Tolls", + LowercaseTitle : "for whom the bell tolls" + } + +During deserialization any elements in the serialized document that +correspond to read-only properties are ignored. + +Driver changes +============== + +MongoServer +----------- + +There is a new method called IsDatabaseNameValid that you can call to test if +a database name is valid. + +MongoDatabase +------------- + +There is a new method called IsCollectionNameValid that you can call to test if a +collection name is valid. + +MongoGridFS +----------- + +You can now disable computing the MD5 at the server when uploading a GridFS +file. You can also disable the client side verification of the MD5 that is +normally done on Upload or Download. The reason you might choose to disable +MD5 verification is that it is computationally expensive to compute the MD5. + +LINQ OfType\ query operator +------------------------------- + +You can now use the OfType\ query operator in LINQ queries. For example: + + var query = collection.AsQueryable().OfType(); + +this generates a query against the "_t" discriminator value that is used to +identify the actual type of a serialized document. + +Additional expressions supported in LINQ where clauses +------------------------------------------------------ + +The following expressions are now supported in LINQ where clauses: + + // d is the document + // p is a property of the document + // c is a character constant + // ca is an array of character constants + // s is a string constant + // i, j, k, n are integer constants + + where d.p.Equals(constant) + where string.IsNullOrEmpty(d.p) + where d.p.IndexOf(c) == i + where d.p.IndexOf(c, j) == i + where d.p.IndexOf(c, j, k) == i + where d.p.IndexOf(s) == i + where d.p.IndexOf(s, j) == i + where d.p.IndexOf(s, j, k) == i + where d.p.IndexOfAny(ca) == i + where d.p.IndexOfAny(ca, j) == i + where d.p.IndexOfAny(ca, j, k) == i + where d.p[i] == c + where d.p.Length == n + where d.p.ToLower().Contains("xyz") + where d.p.ToLower().StartsWith("xyz") + where d.p.ToLower().EndsWith("xyz") + where d.p.ToUpper().Contains("xyz") + where d.p.ToUpper().StartsWith("xyz") + where d.p.ToUpper().EndsWith("xyz") + where d.p.Trim().Contains("xyz") + where d.p.Trim().StartsWith("xyz") + where d.p.Trim().EndsWith("xyz") + where d.p.TrimStart().Contains("xyz") + where d.p.TrimStart().StartsWith("xyz") + where d.p.TrimStart().EndsWith("xyz") + where d.p.TrimEnd().Contains("xyz") + where d.p.TrimEnd().StartsWith("xyz") + where d.p.TrimEnd().EndsWith("xyz") + where d.GetType() == typeof(T) + where d is T + + // you can use any combination of ToLower/ToUpper/Trim/TrimStart/TrimEnd + // before Contains/StartsWith/EndsWith + +In the 1.4 version of the C# driver the constant always had to appear on the +right of a comparison operator. That restriction is lifted in 1.4.1 so now the +following are equivalent: + + where d.Height < 60 + where 60 > d.Height + +Type of \ in AsQueryable can now be deduced +----------------------------------------------- + +The type of \ in the call to AsQueryable can now be deduced from the collection argument: + + var collection = database.GetCollection("mydocuments") + var query = collection.AsQueryable(); // is deduced to be MyDocument diff --git a/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.dll b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.dll new file mode 100644 index 000000000..d9c42323a Binary files /dev/null and b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.dll differ diff --git a/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.pdb b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.pdb new file mode 100644 index 000000000..a406e146c Binary files /dev/null and b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.pdb differ diff --git a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.xml b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.xml similarity index 98% rename from packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.xml rename to packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.xml index 51f31505c..25b987437 100644 --- a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.xml +++ b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Bson.xml @@ -2305,6 +2305,25 @@ The frozen serialization options. + + + Supports using type names as discriminators. + + + + + Resolves a type name discriminator. + + The type name. + The type if type type name can be resolved; otherwise, null. + + + + Gets a type name to be used as a discriminator (like AssemblyQualifiedName but shortened for common DLLs). + + The type. + The type name. + An interface implemented by classes that handle their own BSON serialization. @@ -3697,9 +3716,9 @@ The SerializationInfo. The StreamingContext. - + - Represents an Id generator for BsonObjectIds. + Represents an Id generator for Guids stored in BsonBinaryData values. @@ -3722,6 +3741,64 @@ The Id. True if the Id is empty. + + + Initializes a new instance of the BsonBinaryDataGuidGenerator class. + + The GuidRepresentation to use when generating new Id values. + + + + Gets the instance of BsonBinaryDataGuidGenerator for a GuidRepresentation. + + The GuidRepresentation. + The instance of BsonBinaryDataGuidGenerator for a GuidRepresentation. + + + + Generates an Id for a document. + + The container of the document (will be a MongoCollection when called from the C# driver). + The document. + An Id. + + + + Tests whether an Id is empty. + + The Id. + True if the Id is empty. + + + + Gets an instance of BsonBinaryDataGuidGenerator for CSharpLegacy GuidRepresentation. + + + + + Gets an instance of BsonBinaryDataGuidGenerator for JavaLegacy GuidRepresentation. + + + + + Gets an instance of BsonBinaryDataGuidGenerator for PythonLegacy GuidRepresentation. + + + + + Gets an instance of BsonBinaryDataGuidGenerator for Standard GuidRepresentation. + + + + + Gets an instance of BsonBinaryDataGuidGenerator for Unspecifed GuidRepresentation. + + + + + Represents an Id generator for BsonObjectIds. + + Initializes a new instance of the BsonObjectIdGenerator class. @@ -4613,6 +4690,11 @@ Gets or sets whether to check an update document (turns CheckElementNames on if first element name does *not* start with $). + + + Gets the current serialization depth. + + Gets the settings of the writer. @@ -5505,6 +5587,11 @@ Gets whether the settings are frozen. + + + Gets or sets the max serialization depth allowed (used to detect circular references). + + Initializes a new instance of the BsonDocumentWriterSettings class. @@ -6221,13 +6308,6 @@ The member info. The type of the member. - - - Gets a loadable type name (like AssemblyQualifiedName but shortened when possible) - - The type. - The type name. - Checks whether a class map is registered for a type. @@ -6296,10 +6376,10 @@ - Gets a member map. + Gets a member map (only considers members declared in this class). The member name. - The member map. + The member map (or null if the member was not found). @@ -6431,6 +6511,11 @@ The name of the property. + + + Gets all the member maps (including maps for inherited members). + + Gets the base class map. @@ -6446,6 +6531,11 @@ Gets the conventions used with this class. + + + Gets the declared member maps (only for members declared in this class). + + Gets the discriminator. @@ -6629,6 +6719,11 @@ Specifies the element name and related options for a field or property. + + + Initializes a new instance of the BsonElementAttribute class. + + Initializes a new instance of the BsonElementAttribute class. @@ -7462,6 +7557,78 @@ Gets the external representation. + + + Represents how duplicate names should be handled. + + + + + Overwrite original value with new value. + + + + + Ignore duplicate name and keep original value. + + + + + Throw an exception. + + + + + Represents options used by the BsonTypeMapper. + + + + + Initializes a new instance of the BsonTypeMapperOptions class. + + + + + Clones the BsonTypeMapperOptions. + + The cloned BsonTypeMapperOptions. + + + + Freezes the BsonTypeMapperOptions. + + The frozen BsonTypeMapperOptions. + + + + Gets or sets the default BsonTypeMapperOptions. + + + + + Gets or sets how duplicate names should be handled. + + + + + Gets whether the BsonTypeMapperOptions is frozen. + + + + + Gets or sets the type that a BsonArray should be mapped to. + + + + + Gets or sets the type that a BsonDocument should be mapped to. + + + + + Gets or sets whether binary sub type OldBinary should be mapped to byte[] the way sub type Binary is. + + Represents an ObjectId (see also BsonObjectId). @@ -7471,7 +7638,7 @@ Initializes a new instance of the ObjectId class. - The value. + The bytes. @@ -10347,7 +10514,7 @@ Initializes a new instance of the BsonObjectId class. - The value. + The bytes. @@ -10709,7 +10876,7 @@ Converts a byte array to a BsonBinaryData. - A byte array. + A byte array. A BsonBinaryData. @@ -12752,6 +12919,14 @@ Gets the default value. + + + Gets whether the member is readonly. + + + Readonly indicates that the member is written to the database, but not read from the database. + + Represents a serializer for dictionaries. @@ -12918,7 +13093,22 @@ An object. The BsonType to map to. - A BsonValue. + A BsonValue of the desired type (or BsonNull.Value if value is null and bsonType is Null). + + + + Maps a BsonValue to a .NET value using the default BsonTypeMapperOptions. + + The BsonValue. + The mapped .NET value. + + + + Maps a BsonValue to a .NET value. + + The BsonValue. + The BsonTypeMapperOptions. + The mapped .NET value. @@ -13243,6 +13433,11 @@ Gets or sets the default max document size. The default is 4MiB. + + + Gets or sets the default max serialization depth (used to detect circular references during serialization). The default is 100. + + Indicates that this field or property should be ignored when this class is serialized. diff --git a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.XML b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.XML similarity index 99% rename from packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.XML rename to packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.XML index d1fcc0e62..54558b3e9 100644 --- a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.XML +++ b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.XML @@ -152,6 +152,11 @@ The LINQ query expression tree. + + + Gets the final result type if an OfType query operator was used (otherwise null). + + Gets a list of Expressions that defines the sort order (or null if not specified). @@ -2695,6 +2700,37 @@ An enumerator for the result objects. + + + A class that finds the first parameter in an expression. + + + + + Initializes a new instance of the ExpressionParameterFinder class. + + + + + Finds the first parameter in an expression. + + The expression containing the parameter that should be found. + The first parameter found in the expression (or null if none was found). + + + + Visits an Expression. + + The Expression. + The Expression (posibly modified). + + + + Remembers this parameter if it is the first parameter found. + + The ParameterExpression. + The ParameterExpression. + Represents a MongoDB GridFS exception. @@ -4222,6 +4258,16 @@ Gets or sets the safe mode. + + + Gets or sets whether to udpate the MD5 hash on the server when a file is uploaded or modified. + + + + + Gets or sets whether to verify the MD5 hash when a file is uploaded or downloaded. + + Represents a pool of connections to a MongoDB server. @@ -5566,6 +5612,14 @@ An instance of DatabaseStatsResult. + + + Checks whether a given collection name is valid in this database. + + The collection name. + An error message if the collection name is not valid. + True if the collection name is valid; otherwise, false. + Removes a user from this database. @@ -6485,6 +6539,14 @@ The name of the collection. An instance of IQueryable{{T}} for a MongoCollection. + + + Returns an instance of IQueryable{{T}} for a MongoCollection. + + The type of the returned documents. + The name of the collection. + An instance of IQueryable{{T}} for a MongoCollection. + Represents a thread-safe queue. @@ -7579,6 +7641,14 @@ Credentials for the admin database. The last error () + + + Checks whether a given database name is valid on this server. + + The database name. + An error message if the database name is not valid. + True if the database name is valid; otherwise, false. + Checks whether the server is alive (throws an exception if not). If server is a replica set, pings all members one at a time. diff --git a/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.dll b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.dll new file mode 100644 index 000000000..19fe23e97 Binary files /dev/null and b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.dll differ diff --git a/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.pdb b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.pdb new file mode 100644 index 000000000..ce3d417aa Binary files /dev/null and b/packages/mongocsharpdriver.1.4.1/lib/net35/MongoDB.Driver.pdb differ diff --git a/packages/mongocsharpdriver.1.4.1/mongocsharpdriver.1.4.1.nupkg b/packages/mongocsharpdriver.1.4.1/mongocsharpdriver.1.4.1.nupkg new file mode 100644 index 000000000..a55d56ebc Binary files /dev/null and b/packages/mongocsharpdriver.1.4.1/mongocsharpdriver.1.4.1.nupkg differ diff --git a/packages/mongocsharpdriver.1.4/Release Notes v1.4.txt b/packages/mongocsharpdriver.1.4/Release Notes v1.4.txt deleted file mode 100644 index d0f0c911e..000000000 --- a/packages/mongocsharpdriver.1.4/Release Notes v1.4.txt +++ /dev/null @@ -1,348 +0,0 @@ -C# Driver Version 1.4 Release Notes -=================================== - -The major feature of this release is support for LINQ queries. Some of the other -changes (e.g. new IBsonSerializer methods) are also in support of the new LINQ -implementation. - -File by file change logs are available at: - -https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Change%20Log%20v1.4-Bson.txt -https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20Notes/Change%20Log%20v1.4-Driver.txt - -These release notes describe the changes at a higher level, and omit describing -some of the minor changes. - -Breaking changes ----------------- - -There are some breaking changes in this release. Some of them are only breaking -at the binary level and are easily taken care of by simply recompiling your -application. Others require minor changes to your source code. Many of the -breaking changes are in low level classes, and these won't affect most users, -unless for example you are doing things like writing custom serializers. - -Please read these release notes carefully before adopting the new 1.4 release -of the C# driver to determine if any of the breaking changes affect you. - -LINQ query support ------------------- - -As stated previously, the major feature of this release is support for LINQ -queries. These release notes don't describe the new LINQ support, for that -please refer to the online LINQ tutorial at: - -http://www.mongodb.org/display/DOCS/CSharp+Driver+LINQ+Tutorial - -(Please note that the LINQ tutorial won't be available until several weeks -after the 1.4 release has been shipped. Sorry.) - -CLS compliance --------------- - -Both the MongoDB.Bson.dll and MongoDB.Driver.dll libraries have been marked -as CLS compliant, which should make them more useful from other .NET languages. -Most of the changes required to make the libraries CLS compliant are not even -visible in the public interface. - -Release builds --------------- - -Starting with the 1.4 version we are shipping Release builds of the DLLs. - -Code formatting changes ------------------------ - -In response to popular demand the code base has been reformatted using the -default Visual Studio C# code formatting settings. We have also adopted -the convention of prefixing instance field names with a single "_" and static -fields names with a double "__" (while this convention for static fields is -not common it is very useful). One of the nice benefits of these conventions -is that the drop down menu in Visual Studio that displays class members ends -up grouping all static fields first, followed by instance fields, followed by -the rest of the properties and methods. - -BSON library changes -==================== - -ArraySerializationOptions -------------------------- - -This new class allows you to specify serialization options for array-like -members. Initially the only option available is to specify serialization -options for the items of the array. When using attributes to specify -serialization options any attributes that don't apply to the collection as a -whole implictly apply to the items of the collection. - -BsonDateTime is now a pure BSON DateTime value ----------------------------------------------- - -In previous versions the BsonDateTime class stored its value twice in two -different private fields: _millisecondsSinceEpoch (a long) and _value (a .NET -DateTime). The idea was that you could store a .NET DateTime without losing any -precision. However, that turns out to be confusing because as soon as you save -the BsonDateTime value to the database and read it back you are going to lose -precision anyway, so you might as well lose it right up front and not make -false promises. - -BsonDateTime also has two new helper methods: ToLocalTime and ToUniversalTime. -These methods convert the BSON DateTime to either local or UTC .NET DateTime -values. There are also new AsLocalTime and AsUniversalTime properties in -BsonValues that can be used to convert BsonValues to .NET DateTime values (like -all AsXyz properties in BsonValue they throw an InvalidCastException if the -BsonValue is not actually a BsonDateTime). - -BsonIgnoreExtraElements attribute ---------------------------------- - -The BsonIgnoreExtraElements attribute has a new property called Inherited. If -this property is set to true then all classes derived from this one will -automatically inherit this setting, which makes it easy to set it for an -entire class hierarchy at once. - -BsonIgnoreIfDefault attribute ------------------------------ - -This new attribute allows you to specify that you want a field to be ignored -during serialization if it is equal to the default value. This replaces the -SerializeDefaultValue parameter of the BsonDefaultValue attribute. By making -this a separate attribute you can specify that you want the default value -ignored without having to specify the default value as well. - -BsonReader: CurrentBsonType vs GetCurrentBsonType -------------------------------------------------- - -In previous versions the CurrentBsonType property had side effects. In general -it is bad form for the get accessor of a property to have side effects, as even -something as simple as looking at the value of the property in a debugger can -have unintended consequences. Therefore, in the 1.4 release the CurrentBsonType -property has no side effects. The previous behavior is now implemented in the -GetCurrentBsonType method. While this is mostly an internal change, *if* you -have written a custom serializer that used the CurrentBsonType property and -were relying on its side effects you will have to change your custom serializer -to call GetCurrentBsonType instead. - -ConventionProfile new conventions ---------------------------------- - -The ConventionProfile class has two new conventions: IgnoreIfDefaultConvention -and SerializationOptionsConvention. Also, the SerializeDefaultValueConvention -has been obsoleted in favor of the new IgnoreIfDefaultConvention. - -DictionarySerializationOptions ------------------------------- - -This class has a new property called ItemSerializationOptions that can be used -to specify the options to use when serializing the value of the items in the -dictionary. When using attributes to specify serialization options, any -attributes that don't apply to the dictionary as a whole implicitly apply to -the value of the items in the dictionary. - -ExtraElements -------------- - -Previous versions of the C# driver allowed you to specify a field of the class -to be used to store any extra elements encountered during deserialization. -However, this field *had* to be of type BsonDocument, which meant introducing -a dependency on the driver into your data model classes (which some developers -don't want to do). You now have the additional option of declaring your -ExtraElements field to be of type IDictionary\ instead. - -IBsonSerializationOptions -------------------------- - -The IBsonSerializationOptions has several new methods. ApplyAttribute is used -during the AutoMap process to apply an attribute to some serialization options -that are being built incrementally (starting from the default serialization -options). This provides an extensible mechanism for applying new attributes to -new serialization options classes. The Clone and Freeze methods are introduced -to allow serialization options to be converted to read-only once initialization -is complete to provide thread safety. - -IBsonSerializer ---------------- - -The IBsonSerializer has several new methods. GetDefaultSerializationOptions -provides an initial set of serialization options that any serialization -attributes found can be applied against. GetItemSerializationInfo provides -serialization info about the items and applies only to serializers for -collection-like classes. GetMemberSerializationInfo provides serialization -info about members of a class. The last two are used in the implementation -of LINQ queries. - -Image/Bitmap serializers ------------------------- - -New serializers have been provided for the Image abstract base class and the -Bitmap class derived from it. - -ISupportInitialize ------------------- - -The ISupportInitialize interface defines two methods: BeginInit and EndInit. -The BsonClassMapSerializer now checks whether the class being deserialized -implements this interface, and if so, calls BeginInit just before it starts -to deserialize a class, and EndInit just after it has finished. You can -use this feature to do any pre- or post-processing. - -ObjectId/BsonObjectId creation ------------------------------- - -ObjectId (and BsonObjectId) have a new constructor that allows you to supply -the timestamp as a .NET DateTime value and it will automatically be converted -to seconds since the Unix Epoch. These new constructors are useful if you want -to create artificial ObjectIds to use in range based ObjectId queries (in -which case you will usually set the machine, pid and increment fields to zero). - -There are also two new overloads of GenerateNewId that allow you to provide -the desired timestamp as either an int or a .NET DateTime. These new overloads -are useful if you need to create backdated ObjectIds. When generating backdated -ObjectIds there is a slight risk that you might create an ObjectId that is -not unique (but that risk is very small). - -TimeSpanSerializationOptions ----------------------------- - -You can now choose any of the following representations for a TimeSpan: string, -double, Int32 or Int64. In addition, when using any of the numeric -representations, you can use the Units property to choose the units that the -numeric value is in (choose from: Ticks, Days, Hours, Minutes, Seconds, -Milliseconds and Nanoseconds). - -Driver changes -============== - -Authentication support improved -------------------------------- - -Operations that require admin credentials previously required you to set the -DefaultCredentials of MongoServerSetttings to admin credentials. But that is -undesirable because it provides the client code full access to all databases, -essentially negating the benefit of using authentication in the first place. -In the 1.4 release all operations that require admin credentials have a new -overload where you can provide the needed credentials; you no longer have to -set the DefaultCredentials. Another option is to store credentials for the -admin database in the new MongoCredentialsStore. - -Connection pool defaults changed --------------------------------- - -The default value of WaitQueueMultiple has been changed from 1.0 to 5.0 and the -default value of WaitQueueTimeout has been changed from 0.5 seconds to 2 -minutes. These new values are taken from the Java driver, where they have -reportedly been working well for users running under heavy loads. These new -values mean that many more threads can be waiting for a longer time before a -timeout exception is thrown. - -Exceptions are no longer caught and rethrown when possible ----------------------------------------------------------- - -Wherever possible exception handling code that used to use catch exceptions -and rethrow them after processing them has been changed to roughly equivalent -code that uses try/finally to accomplish the same objective. This is specially -helpful if you are running the debugger set to stop whenever an exception is -thrown. - -IBsonSerializable semi-deprecated ---------------------------------- - -The LINQ support relies heavily on the new methods added to IBsonSerializer. -Because of this it is highly encouraged that *if* you have to handle your own -serialization that you always opt to write an IBsonSerializer for your class -instead of having it implement IBsonSerializable (see the notes for MongoDBRef -and SystemProfileInfo for examples of where the driver itself has switched -from IBsonSerializable to using a IBsonSerializer). IBsonSerializable still -has a modest role to play in classes that just need to be serialized quickly -and simply and for which we won't be writing LINQ queries (for example, the -driver's Builders and Wrappers still use IBsonSerializable). - -LINQ query support ------------------- - -As mentioned earlier in the release notes more information about the new -support for LINQ queries can be found in the forthcoming LINQ tutorial: - -http://www.mongodb.org/display/DOCS/CSharp+Driver+LINQ+Tutorial - -Locking issues --------------- - -A number of locking issues related to connection pooling have been resolved. -These issues were particularly likely to occur if you had more threads than -the maximum size of the connection pool and were using the connections heavily -enough that the connection pool could be used up. - -MongoCredentialsStore ---------------------- - -You can now create a credentials store which contains credentials for multiple -databases (the name of the database is the key and the credentials are the -value). The credentials store must be set up (in the MongoServerSettings) -before you call MongoServer.Create, so it is only intended for scenarios -where you have a fixed set of credentials that aren't going to change at runtime. - -MongoDBRef no longer implements IBsonSerializable -------------------------------------------------- - -MongoDBRef used to handle its own serialization by virtue of implementing -IBsonSerializable. But the IBsonSerializable interface is not helpful when we -try to add support for writing LINQ queries against components of a MongoDBRef. -Instead, there is now a MongoDBRefSerializer which handles serialization of -MongoDBRefs, as well as implementing GetMemberSerializationInfo which enables -the LINQ implementation to support LINQ queries against MongoDBRefs. - -MongoInsertOptions/MongoUpdateOptions constructor changed ---------------------------------------------------------- - -The constructors for MongoInsertOptions and MongoUpdateOptions used to require -that the collection be passed in as a parameter. The purpose was to allow -the constructor to inherit some of the options from the collection settings. -To the developer however, this was awkward, as it required providing the -collection where it seemed to be redundant. By handling default values in a -different way we no longer require the collection to be supplied to the -constructors. The old constructors (that require the collection parameter) are -still temporarily supported but have been marked as deprecated with a warning. - -MongoServer Admin properties and methods removed ------------------------------------------------- - -The following Admin properties and methods have been removed from MongoServer: -AdminDatabase, GetAdminDatabase, RunAdminCommand, and RunAdminCommandAs. The -reason for removing them is that many developers would never use them anyway, -and adding new overloads for providing admin credentials would have resulted -in even more of these rarely used properties and methods. If you were using -any of these methods or properties they can easily be replaced with calls to -methods of an instance of MongoDatabase (use one of the overloads of -GetDatabase with "admin" as the database name to get a reference to the admin -database). - -RequestStart/RequestDone ------------------------- - -Recall that the purpose of RequestStart is to tell the driver that a series of -operations should all be done using the same connection (which in the case of a -replica set also implies using the same member of the connection set). Which -member of a replica set was chosen depended on the slaveOk parameter: a value -of false meant that the primary had to be used, and a value of true meant that -an arbitrary secondary could be used. A new overload of RequestStart now allows -the caller to specify which member should be used, which can be very useful for -implementing custom query routing algorithms or for querying specific members -of a replica set. In general though, keep in mind that you should *not* be -using RequestStart unless you have an unusual scenario which requires it. - -SocketTimeout default changed ------------------------------ - -The default value for SocketTimeout has been changed from 30 seconds to 0, -which is a special value meaning to use the operating system default value, -which in turn is infinity. If you actually want a SocketTimeout you now -have to set it yourself. The SocketTimeout is currently a server level setting, -but most likely in a future release it will be possible to set it at other -levels, including for individual operations. - -SystemProfileInfo no longer implements IBsonSerializable --------------------------------------------------------- - -See the notes for MongoDBRef. SystemProfileInfo no longer implements -IBsonSerializable for the same reasons, and there is a new -SystemProfileInfoSerializer instead. diff --git a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.dll b/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.dll deleted file mode 100644 index f8bd00fd0..000000000 Binary files a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.dll and /dev/null differ diff --git a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.pdb b/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.pdb deleted file mode 100644 index 2d7440265..000000000 Binary files a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Bson.pdb and /dev/null differ diff --git a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.dll b/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.dll deleted file mode 100644 index 34b88a0dd..000000000 Binary files a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.dll and /dev/null differ diff --git a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.pdb b/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.pdb deleted file mode 100644 index 270355f52..000000000 Binary files a/packages/mongocsharpdriver.1.4/lib/net35/MongoDB.Driver.pdb and /dev/null differ diff --git a/packages/mongocsharpdriver.1.4/mongocsharpdriver.1.4.nupkg b/packages/mongocsharpdriver.1.4/mongocsharpdriver.1.4.nupkg deleted file mode 100644 index 9920c9b64..000000000 Binary files a/packages/mongocsharpdriver.1.4/mongocsharpdriver.1.4.nupkg and /dev/null differ