private Location LookupOrCreate( StatisticsDbContext context, Country country, Institution institution = null, LocalAuthority localAuthority = null, LocalAuthorityDistrict localAuthorityDistrict = null, LocalEnterprisePartnership localEnterprisePartnership = null, MayoralCombinedAuthority mayoralCombinedAuthority = null, Mat multiAcademyTrust = null, OpportunityArea opportunityArea = null, ParliamentaryConstituency parliamentaryConstituency = null, Region region = null, RscRegion rscRegion = null, Sponsor sponsor = null, Ward ward = null, PlanningArea planningArea = null) { var location = Lookup( context, country, institution, localAuthority, localAuthorityDistrict, localEnterprisePartnership, mayoralCombinedAuthority, multiAcademyTrust, opportunityArea, parliamentaryConstituency, region, rscRegion, sponsor, ward, planningArea); if (location == null) { var entityEntry = context.Location.Add(new Location { Id = _guidGenerator.NewGuid(), Country = country ?? Country.Empty(), Institution = institution ?? Institution.Empty(), LocalAuthority = localAuthority ?? LocalAuthority.Empty(), LocalAuthorityDistrict = localAuthorityDistrict ?? LocalAuthorityDistrict.Empty(), LocalEnterprisePartnership = localEnterprisePartnership ?? LocalEnterprisePartnership.Empty(), MayoralCombinedAuthority = mayoralCombinedAuthority ?? MayoralCombinedAuthority.Empty(), MultiAcademyTrust = multiAcademyTrust ?? Mat.Empty(), OpportunityArea = opportunityArea ?? OpportunityArea.Empty(), ParliamentaryConstituency = parliamentaryConstituency ?? ParliamentaryConstituency.Empty(), Region = region ?? Region.Empty(), RscRegion = rscRegion ?? RscRegion.Empty(), Sponsor = sponsor ?? Sponsor.Empty(), Ward = ward ?? Ward.Empty(), PlanningArea = planningArea ?? PlanningArea.Empty() }); return(entityEntry.Entity); } return(location); }