This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I have some list of things (typically IDs) that I want to do work on. | |
var fooIds = fooObjects.Select(f => f.FooId).ToList(); | |
// #1 | |
// This is my preference, because it's easier (for me) to spot the fact that we are taking some kind of important action. | |
// Examples 2 and 3 are easier to mis-read. At first glance I read them as somehow querying/filtering/modifying the list | |
// of ids, instead of as taking some kind of action on them. | |
foreach (var fooId in fooIds) | |
{ | |
teamService.NotifyFooChanged(fooId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IFooDAO returns: | |
public class BaseFoo { | |
[BsonId] | |
public long _Id { get; set;} | |
} | |
// IFooService returns: | |
public class FooDTO { | |
public string FooId { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public PlayCard GetClosestMatch(PlayCard playCard, long teamId) | |
{ | |
try | |
{ | |
var solr = SolrProxy.GetConnection<IndexedPlayCard>(); | |
var playCardDataQueries = IndexedPlayCard.GetPlayCardDataQueries(playCard.Data); | |
if (!playCardDataQueries.Any()) return null; | |
var results = solr.Query(new SolrMultipleCriteriaQuery(playCardDataQueries), new QueryOptions | |
{ |
NewerOlder