Skip to content

Instantly share code, notes, and snippets.

@codereflection
Created June 23, 2011 16:24
Show Gist options
  • Select an option

  • Save codereflection/1042905 to your computer and use it in GitHub Desktop.

Select an option

Save codereflection/1042905 to your computer and use it in GitHub Desktop.
Which is most readable for determining the business logic?
public IList<Trade> GetComplianceReportTradesBy(ComplianceStatus complianceStatus)
{
return GetBy(new List<ICriterion>
{
Restrictions.Where<Trade>(x => x.ComplianceStatus == complianceStatus.ToString()),
Restrictions.Where<Trade>(x => x.RecordType == TradeRecordType.ClientAllocation.ToString()),
Restrictions.Where<Trade>(x => x.ComplianceExported == false),
Restrictions.Where<Trade>(x => x.LineOfBusiness != LinesOfBusiness.SO.ToString()),
Restrictions.Where<Trade>(x => x.Canceled == false),
Restrictions.On<Trade>(x => x.AddBust).IsInsensitiveLike("ADD", MatchMode.Exact)
})
.OrderBy(x => x.Compliance_ParentOrderAcknowledgement).ToList();
}
public IList<Trade> GetComplianceReportTradesBy(ComplianceStatus complianceStatus)
{
return GetBy(new List<ICriterion>
{
Restrictions.Where<Trade>(x => x.ComplianceStatus == complianceStatus.ToString()
&& x.RecordType == TradeRecordType.ClientAllocation.ToString()
&& x.ComplianceExported == false
&& x.LineOfBusiness != LinesOfBusiness.SO.ToString()
&& x.Canceled == false),
Restrictions.On<Trade>(x => x.AddBust).IsInsensitiveLike("ADD", MatchMode.Exact)
})
.OrderBy(x => x.Compliance_ParentOrderAcknowledgement).ToList();
}
public IList<Trade> GetComplianceReportTradesBy(ComplianceStatus complianceStatus)
{
return worker.On(connection, session => session.QueryOver<Trade>()
.Where(x => x.ComplianceStatus == complianceStatus.ToString()
&& x.ComplianceStatus != ComplianceStatus.Exported.ToString()
&& x.RecordType == TradeRecordType.ClientAllocation.ToString()
&& x.ComplianceExported == false
&& x.LineOfBusiness != LinesOfBusiness.SO.ToString()
&& x.Canceled == false)
.AndRestrictionOn(x => x.AddBust).IsInsensitiveLike("ADD")
.OrderBy(x => x.Compliance_ParentOrderAcknowledgement).Asc)
.List() as List<Trade>;
}
public IList<Trade> GetComplianceReportTradesBy(ComplianceStatus complianceStatus)
{
return GetBy(
x => x.ComplianceStatus == complianceStatus.ToString()
&& x.RecordType == TradeRecordType.ClientAllocation.ToString()
&& x.ComplianceExported == false
&& x.LineOfBusiness != LinesOfBusiness.SO.ToString()
&& x.Canceled == false
&& x.AddBust == "ADD")
.OrderBy(x => x.Compliance_ParentOrderAcknowledgement).ToList();
}
public IList<Trade> GetComplianceReportTradesBy(ComplianceStatus complianceStatus)
{
return GetBy(
x => x.ComplianceStatus == complianceStatus.ToString(),
x => x.RecordType == TradeRecordType.ClientAllocation.ToString(),
x => x.ComplianceExported == false,
x => x.LineOfBusiness != LinesOfBusiness.SO.ToString(),
x => x.Canceled == false,
x => x.AddBust == "ADD")
.OrderBy(x => x.Compliance_ParentOrderAcknowledgement).ToList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment