Skip to content

Commit 62e45d9

Browse files
committed
Created a simple console application.
Created a simple console application using ABP and EF.
1 parent 8aa48dc commit 62e45d9

13 files changed

+662
-0
lines changed

AbpEfConsoleApp/.nuget/NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
</configuration>

AbpEfConsoleApp/.nuget/NuGet.exe

1.59 MB
Binary file not shown.

AbpEfConsoleApp/.nuget/NuGet.targets

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21+
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22+
<!--
23+
<PackageSource Include="https://www.nuget.org/api/v2/" />
24+
<PackageSource Include="https://my-nuget-source/nuget/" />
25+
-->
26+
</ItemGroup>
27+
28+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29+
<!-- Windows specific commands -->
30+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31+
</PropertyGroup>
32+
33+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
34+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
35+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
36+
</PropertyGroup>
37+
38+
<PropertyGroup>
39+
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
40+
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
41+
</PropertyGroup>
42+
43+
<PropertyGroup>
44+
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
45+
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
46+
</PropertyGroup>
47+
48+
<PropertyGroup>
49+
<!-- NuGet command -->
50+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
51+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
52+
53+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
54+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 "$(NuGetExePath)"</NuGetCommand>
55+
56+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
57+
58+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
59+
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
60+
61+
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
62+
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
63+
64+
<!-- Commands -->
65+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
66+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
67+
68+
<!-- We need to ensure packages are restored prior to assembly resolve -->
69+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
70+
RestorePackages;
71+
$(BuildDependsOn);
72+
</BuildDependsOn>
73+
74+
<!-- Make the build depend on restore packages -->
75+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
76+
$(BuildDependsOn);
77+
BuildPackage;
78+
</BuildDependsOn>
79+
</PropertyGroup>
80+
81+
<Target Name="CheckPrerequisites">
82+
<!-- Raise an error if we're unable to locate nuget.exe -->
83+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
84+
<!--
85+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
86+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
87+
parallel builds will have to wait for it to complete.
88+
-->
89+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
90+
</Target>
91+
92+
<Target Name="_DownloadNuGet">
93+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
94+
</Target>
95+
96+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
97+
<Exec Command="$(RestoreCommand)"
98+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
99+
100+
<Exec Command="$(RestoreCommand)"
101+
LogStandardErrorAsError="true"
102+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
103+
</Target>
104+
105+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
106+
<Exec Command="$(BuildCommand)"
107+
Condition=" '$(OS)' != 'Windows_NT' " />
108+
109+
<Exec Command="$(BuildCommand)"
110+
LogStandardErrorAsError="true"
111+
Condition=" '$(OS)' == 'Windows_NT' " />
112+
</Target>
113+
114+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
115+
<ParameterGroup>
116+
<OutputFilename ParameterType="System.String" Required="true" />
117+
</ParameterGroup>
118+
<Task>
119+
<Reference Include="System.Core" />
120+
<Using Namespace="System" />
121+
<Using Namespace="System.IO" />
122+
<Using Namespace="System.Net" />
123+
<Using Namespace="Microsoft.Build.Framework" />
124+
<Using Namespace="Microsoft.Build.Utilities" />
125+
<Code Type="Fragment" Language="cs">
126+
<![CDATA[
127+
try {
128+
OutputFilename = Path.GetFullPath(OutputFilename);
129+
130+
Log.LogMessage("Downloading latest version of NuGet.exe...");
131+
WebClient webClient = new WebClient();
132+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
133+
134+
return true;
135+
}
136+
catch (Exception ex) {
137+
Log.LogErrorFromException(ex);
138+
return false;
139+
}
140+
]]>
141+
</Code>
142+
</Task>
143+
</UsingTask>
144+
</Project>

AbpEfConsoleApp/AbpEfConsoleApp.sln

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.30723.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AbpEfConsoleApp", "AbpEfConsoleApp\AbpEfConsoleApp.csproj", "{5BA12534-5A5D-4A11-B506-3D1275F2329C}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{6E79FCAE-D593-4F93-9BF2-D989BFAC451C}"
9+
ProjectSection(SolutionItems) = preProject
10+
.nuget\NuGet.Config = .nuget\NuGet.Config
11+
.nuget\NuGet.exe = .nuget\NuGet.exe
12+
.nuget\NuGet.targets = .nuget\NuGet.targets
13+
EndProjectSection
14+
EndProject
15+
Global
16+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
17+
Debug|Any CPU = Debug|Any CPU
18+
Release|Any CPU = Release|Any CPU
19+
EndGlobalSection
20+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
21+
{5BA12534-5A5D-4A11-B506-3D1275F2329C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22+
{5BA12534-5A5D-4A11-B506-3D1275F2329C}.Debug|Any CPU.Build.0 = Debug|Any CPU
23+
{5BA12534-5A5D-4A11-B506-3D1275F2329C}.Release|Any CPU.ActiveCfg = Release|Any CPU
24+
{5BA12534-5A5D-4A11-B506-3D1275F2329C}.Release|Any CPU.Build.0 = Release|Any CPU
25+
EndGlobalSection
26+
GlobalSection(SolutionProperties) = preSolution
27+
HideSolutionNode = FALSE
28+
EndGlobalSection
29+
EndGlobal
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5BA12534-5A5D-4A11-B506-3D1275F2329C}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>AbpEfConsoleApp</RootNamespace>
11+
<AssemblyName>AbpEfConsoleApp</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
15+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
16+
<RestorePackages>true</RestorePackages>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="Abp">
39+
<HintPath>..\packages\Abp.0.4.0.0\lib\net451\Abp.dll</HintPath>
40+
</Reference>
41+
<Reference Include="Abp.EntityFramework">
42+
<HintPath>..\packages\Abp.EntityFramework.0.4.0.0\lib\net451\Abp.EntityFramework.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Castle.Core">
45+
<HintPath>..\packages\Castle.Core.3.3.0\lib\net45\Castle.Core.dll</HintPath>
46+
</Reference>
47+
<Reference Include="Castle.Facilities.Logging">
48+
<HintPath>..\packages\Castle.LoggingFacility.3.3.0\lib\net45\Castle.Facilities.Logging.dll</HintPath>
49+
</Reference>
50+
<Reference Include="Castle.Windsor">
51+
<HintPath>..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath>
52+
</Reference>
53+
<Reference Include="EntityFramework">
54+
<HintPath>..\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.dll</HintPath>
55+
</Reference>
56+
<Reference Include="EntityFramework.SqlServer">
57+
<HintPath>..\packages\EntityFramework.6.1.1\lib\net45\EntityFramework.SqlServer.dll</HintPath>
58+
</Reference>
59+
<Reference Include="System" />
60+
<Reference Include="System.Collections.Immutable">
61+
<HintPath>..\packages\Microsoft.Bcl.Immutable.1.0.34\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
62+
</Reference>
63+
<Reference Include="System.ComponentModel.DataAnnotations" />
64+
<Reference Include="System.Core" />
65+
<Reference Include="System.Xml.Linq" />
66+
<Reference Include="System.Data.DataSetExtensions" />
67+
<Reference Include="Microsoft.CSharp" />
68+
<Reference Include="System.Data" />
69+
<Reference Include="System.Xml" />
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="Migrations\201410291734574_InitialCreate.cs" />
73+
<Compile Include="Migrations\201410291734574_InitialCreate.Designer.cs">
74+
<DependentUpon>201410291734574_InitialCreate.cs</DependentUpon>
75+
</Compile>
76+
<Compile Include="Migrations\Configuration.cs" />
77+
<Compile Include="Program.cs" />
78+
<Compile Include="Properties\AssemblyInfo.cs" />
79+
</ItemGroup>
80+
<ItemGroup>
81+
<None Include="App.config" />
82+
<None Include="packages.config" />
83+
</ItemGroup>
84+
<ItemGroup>
85+
<EmbeddedResource Include="Migrations\201410291734574_InitialCreate.resx">
86+
<DependentUpon>201410291734574_InitialCreate.cs</DependentUpon>
87+
</EmbeddedResource>
88+
</ItemGroup>
89+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
90+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
91+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
92+
<PropertyGroup>
93+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
94+
</PropertyGroup>
95+
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
96+
</Target>
97+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
98+
Other similar extension points exist, see Microsoft.Common.targets.
99+
<Target Name="BeforeBuild">
100+
</Target>
101+
<Target Name="AfterBuild">
102+
</Target>
103+
-->
104+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<configSections>
4+
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
5+
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
6+
</configSections>
7+
<connectionStrings>
8+
<add name="Default" connectionString="Server=localhost;Database=AbpEfConsoleApp;Trusted_Connection=True;" providerName="System.Data.SqlClient" />
9+
</connectionStrings>
10+
<startup>
11+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
12+
</startup>
13+
<entityFramework>
14+
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
15+
<providers>
16+
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
17+
</providers>
18+
</entityFramework>
19+
</configuration>

AbpEfConsoleApp/AbpEfConsoleApp/Migrations/201410291734574_InitialCreate.Designer.cs

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace AbpEfConsoleApp.Migrations
2+
{
3+
using System;
4+
using System.Data.Entity.Migrations;
5+
6+
public partial class InitialCreate : DbMigration
7+
{
8+
public override void Up()
9+
{
10+
CreateTable(
11+
"dbo.Users",
12+
c => new
13+
{
14+
Id = c.Guid(nullable: false),
15+
Name = c.String(),
16+
})
17+
.PrimaryKey(t => t.Id);
18+
19+
}
20+
21+
public override void Down()
22+
{
23+
DropTable("dbo.Users");
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)