diff --git a/Bootstrap.DataAccess.MongoDB/Exceptions.cs b/Bootstrap.DataAccess.MongoDB/Exceptions.cs index 545713ee..bea6a93c 100644 --- a/Bootstrap.DataAccess.MongoDB/Exceptions.cs +++ b/Bootstrap.DataAccess.MongoDB/Exceptions.cs @@ -35,16 +35,18 @@ namespace Bootstrap.DataAccess.MongoDB /// public override bool Log(Exception ex, NameValueCollection additionalInfo) { - var excep = new Exceptions(); - excep.Id = null; - excep.AppDomainName = AppDomain.CurrentDomain.FriendlyName; - excep.ErrorPage = additionalInfo?["ErrorPage"]; - excep.ExceptionType = ex.GetType().FullName; - excep.LogTime = DateTime.Now; - excep.Message = ex.Message; - excep.StackTrace = ex.StackTrace; - excep.UserId = additionalInfo?["UserId"]; - excep.UserIp = additionalInfo?["UserIp"]; + var excep = new DataAccess.Exceptions + { + Id = null, + AppDomainName = AppDomain.CurrentDomain.FriendlyName, + ErrorPage = additionalInfo?["ErrorPage"], + ExceptionType = ex.GetType().FullName, + LogTime = DateTime.Now, + Message = ex.Message, + StackTrace = ex.StackTrace, + UserId = additionalInfo?["UserId"], + UserIp = additionalInfo?["UserIp"] + }; MongoDbAccessManager.Exceptions.InsertOne(excep); ClearExceptions(); return true; diff --git a/Bootstrap.DataAccess.MongoDB/MongoDbAccessManager.cs b/Bootstrap.DataAccess.MongoDB/MongoDbAccessManager.cs index 53e226f7..5e082e90 100644 --- a/Bootstrap.DataAccess.MongoDB/MongoDbAccessManager.cs +++ b/Bootstrap.DataAccess.MongoDB/MongoDbAccessManager.cs @@ -206,6 +206,7 @@ namespace Bootstrap.DataAccess.MongoDB md.AutoMap(); md.IdMemberMap.SetSerializer(new StringSerializer(BsonType.ObjectId)); md.IdMemberMap.SetIgnoreIfDefault(true); + md.UnmapMember(ex => ex.Period); }); } if (!BsonClassMap.IsClassMapRegistered(typeof(DataAccess.Log)))