Skip to content

Commit 18b695f

Browse files
authored
Merge pull request #2 from frankodoom/development
Development
2 parents aecb2a8 + 7347b0c commit 18b695f

17 files changed

Lines changed: 339 additions & 18945 deletions

.gitignore

Lines changed: 292 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
14+
15+
# Vscode-specific files
16+
.vscode/
17+
18+
# Build results
19+
[Dd]ebug/
20+
[Dd]ebugPublic/
21+
[Rr]elease/
22+
[Rr]eleases/
23+
x64/
24+
x86/
25+
bld/
26+
[Oo]bj/
27+
[Ll]og/
28+
[Rr]oslyn/
29+
[Bb]in/
30+
31+
# Test results
32+
[Tt]est[Rr]esults/
33+
34+
# Visual Studio 2015 cache/options directory
35+
.vs/
36+
# Uncomment if you have tasks that create the project's static files in wwwroot
37+
#wwwroot/
38+
39+
# MSTest test Results
40+
[Tt]est[Rr]esult*/
41+
[Bb]uild[Ll]og.*
42+
43+
# NUNIT
44+
*.VisualState.xml
45+
TestResult.xml
46+
47+
# Build Results of an ATL Project
48+
[Dd]ebugPS/
49+
[Rr]eleasePS/
50+
dlldata.c
51+
52+
# .NET Core
53+
project.lock.json
54+
project.fragment.lock.json
55+
artifacts/
56+
**/Properties/launchSettings.json
57+
58+
*_i.c
59+
*_p.c
60+
*_i.h
61+
*.ilk
62+
*.meta
63+
*.obj
64+
*.pch
65+
*.pdb
66+
*.pgc
67+
*.pgd
68+
*.rsp
69+
*.sbr
70+
*.tlb
71+
*.tli
72+
*.tlh
73+
*.tmp
74+
*.tmp_proj
75+
*.log
76+
*.vspscc
77+
*.vssscc
78+
.builds
79+
*.pidb
80+
*.svclog
81+
*.scc
82+
83+
# Chutzpah Test files
84+
_Chutzpah*
85+
86+
# Visual C++ cache files
87+
ipch/
88+
*.aps
89+
*.ncb
90+
*.opendb
91+
*.opensdf
92+
*.sdf
93+
*.cachefile
94+
*.VC.db
95+
*.VC.VC.opendb
96+
97+
# Visual Studio profiler
98+
*.psess
99+
*.vsp
100+
*.vspx
101+
*.sap
102+
103+
# TFS 2012 Local Workspace
104+
$tf/
105+
106+
# Guidance Automation Toolkit
107+
*.gpState
108+
109+
# ReSharper is a .NET coding add-in
110+
_ReSharper*/
111+
*.[Rr]e[Ss]harper
112+
*.DotSettings.user
113+
114+
# JustCode is a .NET coding add-in
115+
.JustCode
116+
117+
# TeamCity is a build add-in
118+
_TeamCity*
119+
120+
# DotCover is a Code Coverage Tool
121+
*.dotCover
122+
123+
# Visual Studio code coverage results
124+
*.coverage
125+
*.coveragexml
126+
127+
# NCrunch
128+
_NCrunch_*
129+
.*crunch*.local.xml
130+
nCrunchTemp_*
131+
132+
# MightyMoose
133+
*.mm.*
134+
AutoTest.Net/
135+
136+
# Web workbench (sass)
137+
.sass-cache/
138+
139+
# DocProject is a documentation generator add-in
140+
DocProject/buildhelp/
141+
DocProject/Help/*.HxT
142+
DocProject/Help/*.HxC
143+
DocProject/Help/*.hhc
144+
DocProject/Help/*.hhk
145+
DocProject/Help/*.hhp
146+
DocProject/Help/Html2
147+
DocProject/Help/html
148+
149+
# Click-Once directory
150+
publish/
151+
152+
# Publish Web Output
153+
*.[Pp]ublish.xml
154+
*.azurePubxml
155+
# TODO: Comment the next line if you want to checkin your web deploy settings
156+
# but database connection strings (with potential passwords) will be unencrypted
157+
*.pubxml
158+
*.publishproj
159+
160+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
161+
# checkin your Azure Web App publish settings, but sensitive information contained
162+
# in these scripts will be unencrypted
163+
PublishScripts/
164+
165+
# NuGet Packages
166+
*.nupkg
167+
# The packages folder can be ignored because of Package Restore
168+
**/packages/*
169+
# except build/, which is used as an MSBuild target.
170+
!**/packages/build/
171+
# Uncomment if necessary however generally it will be regenerated when needed
172+
#!**/packages/repositories.config
173+
# NuGet v3's project.json files produces more ignorable files
174+
*.nuget.props
175+
*.nuget.targets
176+
177+
# Microsoft Azure Build Output
178+
csx/
179+
*.build.csdef
180+
181+
# Microsoft Azure Emulator
182+
ecf/
183+
rcf/
184+
185+
# Windows Store app package directories and files
186+
AppPackages/
187+
BundleArtifacts/
188+
Package.StoreAssociation.xml
189+
_pkginfo.txt
190+
191+
# Visual Studio cache files
192+
# files ending in .cache can be ignored
193+
*.[Cc]ache
194+
# but keep track of directories ending in .cache
195+
!*.[Cc]ache/
196+
197+
# Others
198+
ClientBin/
199+
~$*
200+
*~
201+
*.dbmdl
202+
*.dbproj.schemaview
203+
*.jfm
204+
*.pfx
205+
*.publishsettings
206+
orleans.codegen.cs
207+
208+
# Since there are multiple workflows, uncomment next line to ignore bower_components
209+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
210+
#bower_components/
211+
212+
# RIA/Silverlight projects
213+
Generated_Code/
214+
215+
# Backup & report files from converting an old project file
216+
# to a newer Visual Studio version. Backup files are not needed,
217+
# because we have git ;-)
218+
_UpgradeReport_Files/
219+
Backup*/
220+
UpgradeLog*.XML
221+
UpgradeLog*.htm
222+
223+
# SQL Server files
224+
*.mdf
225+
*.ldf
226+
*.ndf
227+
228+
# Business Intelligence projects
229+
*.rdl.data
230+
*.bim.layout
231+
*.bim_*.settings
232+
233+
# Microsoft Fakes
234+
FakesAssemblies/
235+
236+
# GhostDoc plugin setting file
237+
*.GhostDoc.xml
238+
239+
# Node.js Tools for Visual Studio
240+
.ntvs_analysis.dat
241+
node_modules/
242+
243+
# Typescript v1 declaration files
244+
typings/
245+
246+
# Visual Studio 6 build log
247+
*.plg
248+
249+
# Visual Studio 6 workspace options file
250+
*.opt
251+
252+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
253+
*.vbw
254+
255+
# Visual Studio LightSwitch build output
256+
**/*.HTMLClient/GeneratedArtifacts
257+
**/*.DesktopClient/GeneratedArtifacts
258+
**/*.DesktopClient/ModelManifest.xml
259+
**/*.Server/GeneratedArtifacts
260+
**/*.Server/ModelManifest.xml
261+
_Pvt_Extensions
262+
263+
# Paket dependency manager
264+
.paket/paket.exe
265+
paket-files/
266+
267+
# FAKE - F# Make
268+
.fake/
269+
270+
# JetBrains Rider
271+
.idea/
272+
*.sln.iml
273+
274+
# CodeRush
275+
.cr/
276+
277+
# Python Tools for Visual Studio (PTVS)
278+
__pycache__/
279+
*.pyc
280+
281+
# Cake - Uncomment if you are using it
282+
# tools/**
283+
# !tools/packages.config
284+
285+
# Telerik's JustMock configuration file
286+
*.jmconfig
287+
288+
# BizTalk build output
289+
*.btp.cs
290+
*.btm.cs
291+
*.odx.cs
292+
*.xsd.cs

CountryData.Standard.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<Content Include="data.json">
19-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
20-
</Content>
18+
<EmbeddedResource Include="data.json">
19+
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
20+
</EmbeddedResource>
2121
</ItemGroup>
2222

2323
<ItemGroup>

CountryHelper.cs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,28 @@ namespace CountryData.Standard
1010
{
1111
public class CountryHelper
1212
{
13-
private readonly IEnumerable<Country> _Countries;
14-
public CountryHelper()
15-
{
16-
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"data.json");
17-
var json = File.ReadAllText(path);
13+
private readonly IEnumerable<Country> _Countries;
14+
private const string strFileName = "CountryData.Standard.data.json";
15+
public CountryHelper()
16+
{
17+
var json = GetJsonData(strFileName);
1818
_Countries = JsonConvert.DeserializeObject<List<Country>>(json);
1919
}
2020

21+
22+
private string GetJsonData(string path)
23+
{
24+
string json = "";
25+
var assembly = Assembly.GetExecutingAssembly();
26+
using (Stream stream = assembly.GetManifestResourceStream(path))
27+
{
28+
var reader = new StreamReader(stream);
29+
json= reader.ReadToEnd();
30+
31+
}
32+
return json;
33+
}
34+
2135
/// <summary>
2236
/// Returns All Country Data (Region, ShortCode, Country Name)
2337
/// that can be querried by Lambda Expressions

0 commit comments

Comments
 (0)