private void AddCheckin(Checkin checkin, CheckinsContainer checkinsContainer) { Beer beer = checkinsContainer.GetBeer(checkin.Beer.Id); if (beer == null) { beer = checkin.Beer; Brewery brewery = checkinsContainer.GetBrewery(beer.Brewery.Id); if (brewery == null) { brewery = beer.Brewery; Venue venue = brewery.Venue; if (IsUpdateVenue(ref venue, checkinsContainer)) { brewery.Venue = venue; } checkinsContainer.AddBrewery(brewery); } else { beer.Brewery = brewery; } checkinsContainer.AddBeer(beer); } else { checkin.Beer = beer; } FillCheckinVenue(checkin, checkinsContainer); checkinsContainer.AddCheckin(checkin); }
private static void FillBrewery(Brewery brewery, BreweryWeb breweryWeb) { brewery.Id = breweryWeb.BreweryId; brewery.Name = breweryWeb.BreweryName; brewery.Url = $"{UriConstants.BaseUri}brewery/{breweryWeb.BreweryId}"; brewery.Venue.Country = breweryWeb.CountryName; brewery.Venue.City = breweryWeb.Location.BreweryCity; brewery.Venue.State = breweryWeb.Location.BreweryState; brewery.Venue.Latitude = breweryWeb.Location.Lat; brewery.Venue.Longitude = breweryWeb.Location.Lng; brewery.LabelUrl = breweryWeb.BreweryLabel.ToString(); }
public Beer() { Brewery = new Brewery(); }
public void AddBrewery(Brewery brewery) { brewerys.Add(brewery); IsСhanges = true; }