Skip to content

Commit ee4fcc2

Browse files
committed
First commit
0 parents  commit ee4fcc2

21 files changed

+2020
-0
lines changed

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
###################
2+
# compiled source #
3+
###################
4+
*.com
5+
*.class
6+
*.dll
7+
*.exe
8+
*.pdb
9+
*.dll.config
10+
*.cache
11+
*.suo
12+
# Include dlls if they’re in the NuGet packages directory
13+
!/packages/*/lib/*.dll
14+
!/packages/*/lib/*/*.dll
15+
# Include dlls if they're in the CommonReferences directory
16+
!*CommonReferences/*.dll
17+
####################
18+
# VS Upgrade stuff #
19+
####################
20+
UpgradeLog.XML
21+
_UpgradeReport_Files/
22+
###############
23+
# Directories #
24+
###############
25+
bin/
26+
obj/
27+
TestResults/
28+
###################
29+
# Web publish log #
30+
###################
31+
*.Publish.xml
32+
#############
33+
# Resharper #
34+
#############
35+
/_ReSharper.*
36+
*.ReSharper.*
37+
############
38+
# Packages #
39+
############
40+
# it’s better to unpack these files and commit the raw source
41+
# git has its own built in compression methods
42+
*.7z
43+
*.dmg
44+
*.gz
45+
*.iso
46+
*.jar
47+
*.rar
48+
*.tar
49+
*.zip
50+
######################
51+
# Logs and databases #
52+
######################
53+
*.log
54+
*.sqlite
55+
# OS generated files #
56+
######################
57+
.DS_Store?
58+
ehthumbs.db
59+
Icon?
60+
Thumbs.db
61+
[Bb]in
62+
[Oo]bj
63+
[Tt]est[Rr]esults
64+
*.suo
65+
*.user
66+
*.[Cc]ache
67+
*[Rr]esharper*
68+
packages
69+
NuGet.exe
70+
_[Ss]cripts
71+
*.exe
72+
*.dll
73+
*.nupkg
74+
*.ncrunchsolution
75+
*.dot[Cc]over

.vs/config/applicationhost.config

Lines changed: 1039 additions & 0 deletions
Large diffs are not rendered by default.

AspNetCSharpMysqlTemplate.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNetCSharpMysqlTemplate", "AspNetCSharpMysqlTemplate\AspNetCSharpMysqlTemplate.csproj", "{A7E1DFF3-A4CC-415A-860E-ECFF53794A71}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{A7E1DFF3-A4CC-415A-860E-ECFF53794A71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{A7E1DFF3-A4CC-415A-860E-ECFF53794A71}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{A7E1DFF3-A4CC-415A-860E-ECFF53794A71}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{A7E1DFF3-A4CC-415A-860E-ECFF53794A71}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace AspNetCSharpMysqlTemplate
9+
{
10+
public class RouteConfig
11+
{
12+
public static void RegisterRoutes(RouteCollection routes)
13+
{
14+
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
15+
16+
routes.MapRoute(
17+
name: "Default",
18+
url: "{controller}/{action}/{id}",
19+
defaults: new { controller = "Chart", action = "Index", id = UrlParameter.Optional }
20+
);
21+
}
22+
}
23+
}
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
4+
<Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
5+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
6+
<PropertyGroup>
7+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9+
<ProductVersion>
10+
</ProductVersion>
11+
<SchemaVersion>2.0</SchemaVersion>
12+
<ProjectGuid>{A7E1DFF3-A4CC-415A-860E-ECFF53794A71}</ProjectGuid>
13+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
14+
<OutputType>Library</OutputType>
15+
<AppDesignerFolder>Properties</AppDesignerFolder>
16+
<RootNamespace>AspNetCSharpMysqlTemplate</RootNamespace>
17+
<AssemblyName>AspNetCSharpMysqlTemplate</AssemblyName>
18+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
19+
<UseIISExpress>true</UseIISExpress>
20+
<IISExpressSSLPort />
21+
<IISExpressAnonymousAuthentication />
22+
<IISExpressWindowsAuthentication />
23+
<IISExpressUseClassicPipelineMode />
24+
<UseGlobalApplicationHostFile />
25+
<NuGetPackageImportStamp>
26+
</NuGetPackageImportStamp>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
29+
<DebugSymbols>true</DebugSymbols>
30+
<DebugType>full</DebugType>
31+
<Optimize>false</Optimize>
32+
<OutputPath>bin\</OutputPath>
33+
<DefineConstants>DEBUG;TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
38+
<DebugType>pdbonly</DebugType>
39+
<Optimize>true</Optimize>
40+
<OutputPath>bin\</OutputPath>
41+
<DefineConstants>TRACE</DefineConstants>
42+
<ErrorReport>prompt</ErrorReport>
43+
<WarningLevel>4</WarningLevel>
44+
</PropertyGroup>
45+
<ItemGroup>
46+
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
47+
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
48+
<Private>True</Private>
49+
</Reference>
50+
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
51+
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
52+
<Private>True</Private>
53+
</Reference>
54+
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
55+
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
56+
<Private>True</Private>
57+
</Reference>
58+
<Reference Include="Microsoft.CSharp" />
59+
<Reference Include="MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
60+
<HintPath>..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll</HintPath>
61+
<Private>True</Private>
62+
</Reference>
63+
<Reference Include="MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
64+
<SpecificVersion>False</SpecificVersion>
65+
<HintPath>C:\Program Files (x86)\MySQL\MySQL Connector Net 6.9.9\Assemblies\v4.5\MySql.Data.Entity.EF6.dll</HintPath>
66+
</Reference>
67+
<Reference Include="MySql.Web, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
68+
<HintPath>..\packages\MySql.Web.6.9.9\lib\net45\MySql.Web.dll</HintPath>
69+
<Private>True</Private>
70+
</Reference>
71+
<Reference Include="System.Runtime.Serialization" />
72+
<Reference Include="System.Security" />
73+
<Reference Include="System.Web.DynamicData" />
74+
<Reference Include="System.Web.Entity" />
75+
<Reference Include="System.Web.ApplicationServices" />
76+
<Reference Include="System.ComponentModel.DataAnnotations" />
77+
<Reference Include="System" />
78+
<Reference Include="System.Data" />
79+
<Reference Include="System.Core" />
80+
<Reference Include="System.Data.DataSetExtensions" />
81+
<Reference Include="System.Web.Extensions" />
82+
<Reference Include="System.Xml.Linq" />
83+
<Reference Include="System.Drawing" />
84+
<Reference Include="System.Web" />
85+
<Reference Include="System.Xml" />
86+
<Reference Include="System.Configuration" />
87+
<Reference Include="System.Web.Services" />
88+
<Reference Include="System.EnterpriseServices" />
89+
</ItemGroup>
90+
<ItemGroup>
91+
<Reference Include="System.Web.Razor">
92+
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
93+
</Reference>
94+
<Reference Include="System.Web.Webpages">
95+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.dll</HintPath>
96+
</Reference>
97+
<Reference Include="System.Web.Webpages.Deployment">
98+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.Deployment.dll</HintPath>
99+
</Reference>
100+
<Reference Include="System.Web.Webpages.Razor">
101+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Webpages.Razor.dll</HintPath>
102+
</Reference>
103+
<Reference Include="System.Web.Helpers">
104+
<HintPath>..\packages\Microsoft.AspNet.Webpages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
105+
</Reference>
106+
<Reference Include="Microsoft.Web.Infrastructure">
107+
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
108+
</Reference>
109+
<Reference Include="System.Web.Mvc">
110+
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
111+
</Reference>
112+
</ItemGroup>
113+
<ItemGroup>
114+
<Content Include="css\style.css" />
115+
<Content Include="Global.asax" />
116+
<Content Include="Web.config" />
117+
</ItemGroup>
118+
<ItemGroup>
119+
<Compile Include="App_Start\RouteConfig.cs" />
120+
<Compile Include="Controllers\ChartController.cs" />
121+
<Compile Include="Models\fruit.cs" />
122+
<Compile Include="Models\FruitDBContext.cs" />
123+
<Compile Include="Global.asax.cs">
124+
<DependentUpon>Global.asax</DependentUpon>
125+
</Compile>
126+
<Compile Include="Properties\AssemblyInfo.cs" />
127+
</ItemGroup>
128+
<ItemGroup>
129+
<Content Include="Views\web.config" />
130+
<Content Include="packages.config" />
131+
<Content Include="Views\Chart\Index.cshtml" />
132+
<None Include="Web.Debug.config">
133+
<DependentUpon>Web.config</DependentUpon>
134+
</None>
135+
<None Include="Web.Release.config">
136+
<DependentUpon>Web.config</DependentUpon>
137+
</None>
138+
</ItemGroup>
139+
<ItemGroup>
140+
<Folder Include="App_Data\" />
141+
</ItemGroup>
142+
<PropertyGroup>
143+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
144+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
145+
</PropertyGroup>
146+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
147+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
148+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
149+
<ProjectExtensions>
150+
<VisualStudio>
151+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
152+
<WebProjectProperties>
153+
<UseIIS>True</UseIIS>
154+
<AutoAssignPort>True</AutoAssignPort>
155+
<DevelopmentServerPort>57782</DevelopmentServerPort>
156+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
157+
<IISUrl>http://localhost:57782/</IISUrl>
158+
<NTLMAuthentication>False</NTLMAuthentication>
159+
<UseCustomServer>False</UseCustomServer>
160+
<CustomServerUrl>
161+
</CustomServerUrl>
162+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
163+
</WebProjectProperties>
164+
</FlavorProperties>
165+
</VisualStudio>
166+
</ProjectExtensions>
167+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
168+
<PropertyGroup>
169+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
170+
</PropertyGroup>
171+
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
172+
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
173+
</Target>
174+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
175+
Other similar extension points exist, see Microsoft.Common.targets.
176+
<Target Name="BeforeBuild">
177+
</Target>
178+
<Target Name="AfterBuild">
179+
</Target>
180+
-->
181+
</Project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Script.Serialization;
7+
8+
namespace AspNetCSharpMysqlTemplate.Controllers
9+
{
10+
public class ChartController : Controller
11+
{
12+
private FruitDBContext db = new FruitDBContext();
13+
14+
// GET: Chart
15+
public ActionResult Index()
16+
{
17+
var fruits = db.topFruits();
18+
var jsonSerialiser = new JavaScriptSerializer();
19+
var json = jsonSerialiser.Serialize(fruits);
20+
ViewBag.Title = "Anychart ASP.NET C# template";
21+
ViewBag.ChartTitle = "Top 5 fruits";
22+
ViewBag.ChartData = json;
23+
return View(fruits);
24+
}
25+
}
26+
}

AspNetCSharpMysqlTemplate/Global.asax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%@ Application Codebehind="Global.asax.cs" Inherits="AspNetCSharpMysqlTemplate.MvcApplication" Language="C#" %>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace AspNetCSharpMysqlTemplate
9+
{
10+
public class MvcApplication : System.Web.HttpApplication
11+
{
12+
protected void Application_Start()
13+
{
14+
AreaRegistration.RegisterAllAreas();
15+
RouteConfig.RegisterRoutes(RouteTable.Routes);
16+
}
17+
}
18+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
namespace AspNetCSharpMysqlTemplate
2+
{
3+
using System;
4+
using System.Data.Entity;
5+
using System.ComponentModel.DataAnnotations.Schema;
6+
using System.Linq;
7+
using System.Collections.Generic;
8+
9+
public partial class FruitDBContext : DbContext
10+
{
11+
public FruitDBContext()
12+
: base("name=FruitDBContext")
13+
{
14+
}
15+
16+
public virtual DbSet<fruit> fruits { get; set; }
17+
18+
protected override void OnModelCreating(DbModelBuilder modelBuilder)
19+
{
20+
modelBuilder.Entity<fruit>()
21+
.Property(e => e.name)
22+
.IsUnicode(false);
23+
}
24+
25+
public List<fruit> topFruits()
26+
{
27+
return fruits.OrderByDescending(item => item.value).Take(5).ToList();
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)