public AmazonApiLog TrackNewApiCall(AmazonApiSection? apiSection, string apiOperation) { var amazonApiUsage = new AmazonApiLog() { ApiSection = apiSection, ApiOperation = apiOperation, Site = CurrentRequestData.CurrentSite }; return _amazonApiUsageService.Save(amazonApiUsage); }
public void AmazonApiUsageService_Save_ShouldUpdateEntry() { var item = new AmazonApiLog() { ApiSection = AmazonApiSection.Feeds}; Session.Transact(session => session.Save(item)); item.ApiSection = AmazonApiSection.Orders; _amazonApiUsageService.Save(item); Session.Evict(item); Session.QueryOver<AmazonApiLog>().SingleOrDefault().ApiSection.Should().Be(AmazonApiSection.Orders); }
public AmazonApiLog Save(AmazonApiLog amazonApiUsage) { _session.Transact(session => session.SaveOrUpdate(amazonApiUsage)); return amazonApiUsage; }