Skip to content

Commit

Permalink
Merge pull request #17 from Byndyusoft/feature/readme
Browse files Browse the repository at this point in the history
Публикация README в nuget.
  • Loading branch information
Alex-Grigorichev authored Sep 7, 2023
2 parents ce62d50 + d59e479 commit 1dc2c5b
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: install dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: 6.0.x

- name: install packages
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: install dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
dotnet-version: 6.0.x

- name: install packages
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: install dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
dotnet-version: 6.0.x

- name: install packages
run: dotnet restore
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,6 @@ ModelManifest.xml

**/.vs/config/applicationhost.config
src/.vs/**
.vs/**
.vs/**

.idea
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>1.1.4</Version>
<Version>1.1.5</Version>
<RootNamespace>Byndyusoft.ModelResult</RootNamespace>
<Authors>Byndyusoft</Authors>
<PackageTags>Byndyusoft;ModelResult</PackageTags>
Expand Down
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Byndyusoft.ModelResult
Result of domain model logic similar to ActionResult
The result of domain logic, similar to ActionResult

| | | |
| ------- | ------------ | --------- |
Expand All @@ -15,7 +15,7 @@ dotnet add package Byndyusoft.ModelResult

## Usage

ModelResult can be used to return either "ok" or "error" value without explicit casting. Here are some usage examples:
ModelResult can be used to return either an "ok" value or an "error" value without explicit casting. Here are some usage examples:

```csharp
public ModelResult<int> GetId(SampleEntity entity)
Expand Down Expand Up @@ -55,7 +55,7 @@ public ModelResult<EntityInfoDto> GetEntityInfoDto(SampleEntity entity)
```

# ModelResult.AspNetCore
Converter to ActionResult from ModelResult
A converter of ModelResult to ActionResult

## Installing

Expand All @@ -75,11 +75,11 @@ public async Task<ActionResult<EntityInfoDto>> GetEntityInfoDto([FromRoute] long
}
```

If `result` is "ok" result then action method will return message with 200 code and dto content. Otherwise if it is "error" result it is usually will be transformed to 400 code with error info that contains code, message and items. Current version has one exception: if error code is equal to `Byndyusoft.ModelResult.Common.CommonErrorCodes.NotFound` there will be 404 code without any content.
If `result` is an "ok" result then the action method will return a message with the 200 code and the contents of the DTO. Otherwise if it is "error" result it is usually will be transformed to 400 code with error info that contains code, message and items. The current version has one exception: if an error code is equal to `Byndyusoft.ModelResult.Common.CommonErrorCodes.NotFound` there will be the 404 code without any content.

# Contributing

To contribute, you will need to setup your local environment, see [prerequisites](#prerequisites). For the contribution and workflow guide, see [package development lifecycle](#package-development-lifecycle).
To contribute, you will need to setup your local environment, see [prerequisites](#prerequisites). For a contribution and workflow guide, see [package development lifecycle](#package-development-lifecycle).

A detailed overview on how to contribute can be found in the [contributing guide](CONTRIBUTING.md).

Expand All @@ -88,24 +88,14 @@ A detailed overview on how to contribute can be found in the [contributing guide
Make sure you have installed all of the following prerequisites on your development machine:

- Git - [Download & Install Git](https://git-scm.com/downloads). OSX and Linux machines typically have this already installed.
- .NET Core (version 3.1 or higher) - [Download & Install .NET Core](https://dotnet.microsoft.com/download/dotnet-core/3.1).

## General folders layout

### src
- source code

### tests

- unit-tests

- .NET Core (version 6.0 or higher) - [Download & Install .NET Core](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).

## Package development lifecycle

- Implement package logic in `src`
- Add or addapt unit-tests (prefer before and simultaneously with coding) in `tests`
- Add or adapt unit-tests in `tests`
- Add or change the documentation as needed
- Open pull request in the correct branch. Target the project's `master` branch
- Open pull request for a correct branch. Target the project's `master` branch

# Maintainers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<nullable>enable</nullable>
<PackageId>Byndyusoft.ModelResult.AspNetCore</PackageId>
<RootNamespace>Byndyusoft.ModelResult.AspNetCore</RootNamespace>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +17,9 @@
<ProjectReference Include="..\ModelResult\Byndyusoft.ModelResult.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/ModelResult/Byndyusoft.ModelResult.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<TargetFramework>netstandard2.1</TargetFramework>
<PackageId>Byndyusoft.ModelResult</PackageId>
<RootNamespace>Byndyusoft.ModelResult</RootNamespace>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\LICENSE.txt" Pack="true" PackagePath="\"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<nullable>enable</nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace Byndyusoft.ModelResult.ModelResult.Dtos
{
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using AutoFixture;
using Byndyusoft.ModelResult.Dtos;
Expand All @@ -15,7 +14,7 @@ public void SetUp()
_fixture = new Fixture();
}

[NotNull] private Fixture? _fixture;
private Fixture _fixture = default!;

[Test]
public void TestConstructorWithoutItems()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace Byndyusoft.ModelResult.ModelResult.ModelResults
{
using System.Diagnostics.CodeAnalysis;
using AutoFixture;
using Byndyusoft.ModelResult.ModelResults;
using NUnit.Framework;
Expand All @@ -14,7 +13,7 @@ public void SetUp()
_fixture = new Fixture();
}

[NotNull] private Fixture? _fixture;
private Fixture _fixture = default!;

[Test]
public void TestIsOk()
Expand Down

0 comments on commit 1dc2c5b

Please sign in to comment.