public IEnumerable <ItemHistory> GetItemHistory( int?itemId, ItemHistoryType itemType, DateTime from, DateTime to, out DateTime?createdDate, out DateTime?deletedDate, out bool hasRestoredDelete) { if (!Enum.IsDefined(typeof(ItemHistoryType), itemType)) { throw new InvalidEnumArgumentException("itemType", (int)itemType, typeof(ItemHistoryType)); } var createdDateParam = new ObjectParameter("CreatedDate", typeof(DateTime)); var deletedDateParam = new ObjectParameter("DeletedDate", typeof(DateTime)); var hasRestoredDeleteParam = new ObjectParameter("HasRestoredDelete", typeof(bool)); var itemHistory = this.MomentaDb.GetItemHistory( itemId, itemType.ToString(), from, to, createdDateParam, deletedDateParam, hasRestoredDeleteParam).ToList(); createdDate = createdDateParam.Value == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind((DateTime)createdDateParam.Value, DateTimeKind.Utc); deletedDate = deletedDateParam.Value == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind((DateTime)deletedDateParam.Value, DateTimeKind.Utc); hasRestoredDelete = hasRestoredDeleteParam.Value != DBNull.Value && (bool)hasRestoredDeleteParam.Value; return(itemHistory); }
public IEnumerable<ItemRestoredDeleteHistory> GetItemRestoredDeleteHistory( int? itemId, ItemHistoryType itemType) { return this.MomentaDb.GetItemRestoredDeleteHistory(itemId, itemType.ToString()); }
public IEnumerable<ItemHistory> GetItemHistory( int? itemId, ItemHistoryType itemType, DateTime from, DateTime to, out DateTime? createdDate, out DateTime? deletedDate, out bool hasRestoredDelete) { if (!Enum.IsDefined(typeof(ItemHistoryType), itemType)) { throw new InvalidEnumArgumentException("itemType", (int)itemType, typeof(ItemHistoryType)); } var createdDateParam = new ObjectParameter("CreatedDate", typeof(DateTime)); var deletedDateParam = new ObjectParameter("DeletedDate", typeof(DateTime)); var hasRestoredDeleteParam = new ObjectParameter("HasRestoredDelete", typeof(bool)); var itemHistory = this.MomentaDb.GetItemHistory( itemId, itemType.ToString(), from, to, createdDateParam, deletedDateParam, hasRestoredDeleteParam).ToList(); createdDate = createdDateParam.Value == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind((DateTime)createdDateParam.Value, DateTimeKind.Utc); deletedDate = deletedDateParam.Value == DBNull.Value ? (DateTime?)null : DateTime.SpecifyKind((DateTime)deletedDateParam.Value, DateTimeKind.Utc); hasRestoredDelete = hasRestoredDeleteParam.Value != DBNull.Value && (bool)hasRestoredDeleteParam.Value; return itemHistory; }
public IEnumerable <ItemRestoredDeleteHistory> GetItemRestoredDeleteHistory( int?itemId, ItemHistoryType itemType) { return(this.MomentaDb.GetItemRestoredDeleteHistory(itemId, itemType.ToString())); }