-
Notifications
You must be signed in to change notification settings - Fork 13
A.mikhailin #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mnsasha
wants to merge
7
commits into
ExM:master
Choose a base branch
from
mnsasha:a.mikhailin
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
A.mikhailin #32
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c9af2a6
Решение
mnsasha cff375d
Версия 2.0
mnsasha 93a4de7
Доменные объекты теперь internal.
mnsasha 2c7755d
Ручной merge с веткой master (давно ушла вперед).
mnsasha 45dc58f
Поправил после rebase.
mnsasha 836de84
Вернул форматирование.
mnsasha b9b3085
Внес изменения *Fixes из master.
mnsasha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
BuildRevisionCounter.Contract/BuildRevisionCounter.Protocol.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
| <PropertyGroup> | ||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
| <ProjectGuid>{667844E5-6D11-474D-A18F-BC4784626F34}</ProjectGuid> | ||
| <OutputType>Library</OutputType> | ||
| <AppDesignerFolder>Properties</AppDesignerFolder> | ||
| <RootNamespace>BuildRevisionCounter.Protocol</RootNamespace> | ||
| <AssemblyName>BuildRevisionCounter.Protocol</AssemblyName> | ||
| <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
| <FileAlignment>512</FileAlignment> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
| <DebugSymbols>true</DebugSymbols> | ||
| <DebugType>full</DebugType> | ||
| <Optimize>false</Optimize> | ||
| <OutputPath>bin\Debug\</OutputPath> | ||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
| <DebugType>pdbonly</DebugType> | ||
| <Optimize>true</Optimize> | ||
| <OutputPath>bin\Release\</OutputPath> | ||
| <DefineConstants>TRACE</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Reference Include="System" /> | ||
| <Reference Include="System.Core" /> | ||
| <Reference Include="System.Xml.Linq" /> | ||
| <Reference Include="System.Data.DataSetExtensions" /> | ||
| <Reference Include="Microsoft.CSharp" /> | ||
| <Reference Include="System.Data" /> | ||
| <Reference Include="System.Xml" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| <Compile Include="Revision.cs" /> | ||
| <Compile Include="User.cs" /> | ||
| </ItemGroup> | ||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
| Other similar extension points exist, see Microsoft.Common.targets. | ||
| <Target Name="BeforeBuild"> | ||
| </Target> | ||
| <Target Name="AfterBuild"> | ||
| </Target> | ||
| --> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| using System.Reflection; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| // General Information about an assembly is controlled through the following | ||
| // set of attributes. Change these attribute values to modify the information | ||
| // associated with an assembly. | ||
| [assembly: AssemblyTitle("BuildRevisionCounter.Contract")] | ||
| [assembly: AssemblyDescription("")] | ||
| [assembly: AssemblyConfiguration("")] | ||
| [assembly: AssemblyCompany("")] | ||
| [assembly: AssemblyProduct("BuildRevisionCounter.Contract")] | ||
| [assembly: AssemblyCopyright("Copyright © 2015")] | ||
| [assembly: AssemblyTrademark("")] | ||
| [assembly: AssemblyCulture("")] | ||
|
|
||
| // Setting ComVisible to false makes the types in this assembly not visible | ||
| // to COM components. If you need to access a type in this assembly from | ||
| // COM, set the ComVisible attribute to true on that type. | ||
| [assembly: ComVisible(false)] | ||
|
|
||
| // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
| [assembly: Guid("91410165-4321-4bb2-9665-c1c0e36dc1d4")] | ||
|
|
||
| // Version information for an assembly consists of the following four values: | ||
| // | ||
| // Major Version | ||
| // Minor Version | ||
| // Build Number | ||
| // Revision | ||
| // | ||
| // You can specify all the values or you can default the Build and Revision Numbers | ||
| // by using the '*' as shown below: | ||
| // [assembly: AssemblyVersion("1.0.*")] | ||
| [assembly: AssemblyVersion("1.0.0.0")] | ||
| [assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using System; | ||
|
|
||
| namespace BuildRevisionCounter.Protocol | ||
| { | ||
| public class Revision | ||
| { | ||
| public string Id { get; set; } | ||
|
|
||
| public DateTime Created { get; set; } | ||
|
|
||
| public DateTime Updated { get; set; } | ||
|
|
||
| public long CurrentNumber { get; set; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| namespace BuildRevisionCounter.Protocol | ||
| { | ||
| public class User | ||
| { | ||
| public string Name { get; set; } | ||
|
|
||
| public string Password { get; set; } | ||
|
|
||
| public string[] Roles { get; set; } | ||
| } | ||
| } |
92 changes: 92 additions & 0 deletions
92
BuildRevisionCounter.Core/BuildRevisionCounter.Core.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
| <PropertyGroup> | ||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
| <ProjectGuid>{DDF51396-4EE1-45AF-B134-CA1C56B0CD9F}</ProjectGuid> | ||
| <OutputType>Library</OutputType> | ||
| <AppDesignerFolder>Properties</AppDesignerFolder> | ||
| <RootNamespace>BuildRevisionCounter.Core</RootNamespace> | ||
| <AssemblyName>BuildRevisionCounter.Core</AssemblyName> | ||
| <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> | ||
| <FileAlignment>512</FileAlignment> | ||
| <TargetFrameworkProfile /> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
| <DebugSymbols>true</DebugSymbols> | ||
| <DebugType>full</DebugType> | ||
| <Optimize>false</Optimize> | ||
| <OutputPath>bin\Debug\</OutputPath> | ||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
| <DebugType>pdbonly</DebugType> | ||
| <Optimize>true</Optimize> | ||
| <OutputPath>bin\Release\</OutputPath> | ||
| <DefineConstants>TRACE</DefineConstants> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Reference Include="MongoDB.Bson, Version=2.0.0.828, Culture=neutral, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\MongoDB.Bson.2.0.0\lib\net45\MongoDB.Bson.dll</HintPath> | ||
| <Private>True</Private> | ||
| </Reference> | ||
| <Reference Include="MongoDB.Driver, Version=2.0.0.828, Culture=neutral, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\MongoDB.Driver.2.0.0\lib\net45\MongoDB.Driver.dll</HintPath> | ||
| <Private>True</Private> | ||
| </Reference> | ||
| <Reference Include="MongoDB.Driver.Core, Version=2.0.0.828, Culture=neutral, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\MongoDB.Driver.Core.2.0.0\lib\net45\MongoDB.Driver.Core.dll</HintPath> | ||
| <Private>True</Private> | ||
| </Reference> | ||
| <Reference Include="MongoDB.Driver.Legacy, Version=2.0.0.828, Culture=neutral, processorArchitecture=MSIL"> | ||
| <HintPath>..\packages\mongocsharpdriver.2.0.0\lib\net45\MongoDB.Driver.Legacy.dll</HintPath> | ||
| <Private>True</Private> | ||
| </Reference> | ||
| <Reference Include="System" /> | ||
| <Reference Include="System.configuration" /> | ||
| <Reference Include="System.Core" /> | ||
| <Reference Include="System.Xml.Linq" /> | ||
| <Reference Include="System.Data.DataSetExtensions" /> | ||
| <Reference Include="Microsoft.CSharp" /> | ||
| <Reference Include="System.Data" /> | ||
| <Reference Include="System.Xml" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Compile Include="Converters\IUserConverter.cs" /> | ||
| <Compile Include="Converters\IRevisionConverter.cs" /> | ||
| <Compile Include="Converters\Impl\UserConverter.cs" /> | ||
| <Compile Include="DomainObjects\User.cs" /> | ||
| <Compile Include="MongoDBStorage.cs" /> | ||
| <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| <Compile Include="Converters\Impl\RevisionConverter.cs" /> | ||
| <Compile Include="Repositories\Impl\RevisionRepository.cs" /> | ||
| <Compile Include="Repositories\Impl\UserRepository.cs" /> | ||
| <Compile Include="Repositories\IRevisionRepository.cs" /> | ||
| <Compile Include="DomainObjects\Revision.cs" /> | ||
| <Compile Include="Repositories\IUserRepository.cs" /> | ||
| <Compile Include="RepositoryFactory.cs" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="..\BuildRevisionCounter.Contract\BuildRevisionCounter.Protocol.csproj"> | ||
| <Project>{667844e5-6d11-474d-a18f-bc4784626f34}</Project> | ||
| <Name>BuildRevisionCounter.Protocol</Name> | ||
| </ProjectReference> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="packages.config" /> | ||
| </ItemGroup> | ||
| <ItemGroup /> | ||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
| Other similar extension points exist, see Microsoft.Common.targets. | ||
| <Target Name="BeforeBuild"> | ||
| </Target> | ||
| <Target Name="AfterBuild"> | ||
| </Target> | ||
| --> | ||
| </Project> |
11 changes: 11 additions & 0 deletions
11
BuildRevisionCounter.Core/Converters/IRevisionConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| using BuildRevisionCounter.Core.DomainObjects; | ||
|
|
||
| namespace BuildRevisionCounter.Core.Converters | ||
| { | ||
| internal interface IRevisionConverter | ||
| { | ||
| Protocol.Revision ToProtocol(Revision revision); | ||
|
|
||
| Revision ToDomain(Protocol.Revision revision); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| using BuildRevisionCounter.Core.DomainObjects; | ||
|
|
||
| namespace BuildRevisionCounter.Core.Converters | ||
| { | ||
| internal interface IUserConverter | ||
| { | ||
| Protocol.User ToProtocol(User user); | ||
|
|
||
| User ToDomain(Protocol.User user); | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
BuildRevisionCounter.Core/Converters/Impl/RevisionConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| using BuildRevisionCounter.Core.DomainObjects; | ||
|
|
||
| namespace BuildRevisionCounter.Core.Converters.Impl | ||
| { | ||
| internal class RevisionConverter : IRevisionConverter | ||
| { | ||
| public Protocol.Revision ToProtocol(Revision revision) | ||
| { | ||
| var revisionProtocol = new Protocol.Revision | ||
| { | ||
| Id = revision.Id, | ||
| CurrentNumber = revision.CurrentNumber, | ||
| Updated = revision.Updated, | ||
| Created = revision.Created | ||
| }; | ||
|
|
||
| return revisionProtocol; | ||
| } | ||
|
|
||
| public Revision ToDomain(Protocol.Revision revision) | ||
| { | ||
| var revisionDomain = new Revision | ||
| { | ||
| Id = revision.Id, | ||
| CurrentNumber = revision.CurrentNumber, | ||
| Updated = revision.Updated, | ||
| Created = revision.Created | ||
| }; | ||
|
|
||
| return revisionDomain; | ||
| } | ||
| } | ||
| } |
21 changes: 21 additions & 0 deletions
21
BuildRevisionCounter.Core/Converters/Impl/UserConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using BuildRevisionCounter.Core.DomainObjects; | ||
|
|
||
| namespace BuildRevisionCounter.Core.Converters.Impl | ||
| { | ||
| internal class UserConverter : IUserConverter | ||
| { | ||
| public Protocol.User ToProtocol(User user) | ||
| { | ||
| var userProtocol = new Protocol.User { Name = user.Name, Password = user.Password, Roles = user.Roles }; | ||
|
|
||
| return userProtocol; | ||
| } | ||
|
|
||
| public User ToDomain(Protocol.User user) | ||
| { | ||
| var userDomain = new User { Name = user.Name, Password = user.Password, Roles = user.Roles }; | ||
|
|
||
| return userDomain; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using System; | ||
| using MongoDB.Bson.Serialization.Attributes; | ||
|
|
||
| namespace BuildRevisionCounter.Core.DomainObjects | ||
| { | ||
| internal class Revision | ||
| { | ||
| [BsonId] | ||
| public string Id; | ||
|
|
||
| [BsonElement("created"), BsonDateTimeOptions(Kind = DateTimeKind.Utc)] | ||
| public DateTime Created; | ||
|
|
||
| [BsonElement("updated"), BsonDateTimeOptions(Kind = DateTimeKind.Utc)] | ||
| public DateTime Updated; | ||
|
|
||
| [BsonElement("currentNumber")] | ||
| public long CurrentNumber; | ||
| } | ||
| } |
4 changes: 2 additions & 2 deletions
4
BuildRevisionCounter/Model/UserModel.cs → ...evisionCounter.Core/DomainObjects/User.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
полиморфизм не используется - интерфейс не нужен.
Был бы смысл его использовать если бы интерфейс находился в другой сборке, ну или тут присутствовала бы еще одна реализация.