Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Contributing to This Project

We welcome contributions from the community! If you'd like to contribute to this project, please follow these steps:

1. Fork the repository on GitHub.
2. Create a new branch for your feature or bug fix.
3. Make your changes and ensure that they are well-documented.
4. Write tests for your changes to ensure they work as expected.
5. Submit a pull request with a clear description of your changes.

Please make sure to adhere to the project's coding standards and guidelines. We appreciate your efforts to improve this project!

---

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for details.
3 changes: 3 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License

All rights reserved to Jakub Indrák.
22 changes: 5 additions & 17 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,14 @@ Add Attributes to your DTO classes and then enjoy the generated mapping methods

---

## Continuous Integration (GitHub Actions)
## Example

A workflow was added at `.github/workflows/ci.yml` to automate verification and publishing:

- On pull requests (opened/synchronized/reopened):
- Restores, builds the solution and runs tests (if the `TenJames.CompMap.Tests` project exists).
See the [Example](./TenJames.CompMap.Example) project for a complete working example.

Quick commands (run locally) — fish shell:

```fish
# Build and test locally
dotnet restore
dotnet build TenJames.CompMap.sln -c Release
dotnet test TenJames.CompMap/TenJames.CompMap.Tests -c Release
## Contributing

# Create a tag and push (publish via CI)
git tag v1.2.3
git push origin v1.2.3
```

If you'd prefer bumping major/minor instead of patch in PRs, or if you want bumping to commit via a bot account or a separate branch/PR, I can adapt the workflow.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.

---
see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
10 changes: 5 additions & 5 deletions TenJames.CompMap.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TenJames.CompMap", "TenJame
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TenJames.CompMap.Tests", "TenJames.CompMap\TenJames.CompMap.Tests\TenJames.CompMap.Tests.csproj", "{045DCA29-C2DC-4707-9521-98097B1B2F84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TenJames.CompMap.Example", "TenJames.CompMap.Example\TenJames.CompMap.Example.csproj", "{B4418CCB-2984-4651-ABE3-E14B620171C3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TenJames.CompMap.Example", "TenJames.CompMap\TenJames.CompMap.Example\TenJames.CompMap.Example.csproj", "{B7BB7EF5-EBA5-45F2-903F-9A0DBCAD0D9C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -20,9 +20,9 @@ Global
{045DCA29-C2DC-4707-9521-98097B1B2F84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{045DCA29-C2DC-4707-9521-98097B1B2F84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{045DCA29-C2DC-4707-9521-98097B1B2F84}.Release|Any CPU.Build.0 = Release|Any CPU
{B4418CCB-2984-4651-ABE3-E14B620171C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4418CCB-2984-4651-ABE3-E14B620171C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4418CCB-2984-4651-ABE3-E14B620171C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4418CCB-2984-4651-ABE3-E14B620171C3}.Release|Any CPU.Build.0 = Release|Any CPU
{B7BB7EF5-EBA5-45F2-903F-9A0DBCAD0D9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7BB7EF5-EBA5-45F2-903F-9A0DBCAD0D9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7BB7EF5-EBA5-45F2-903F-9A0DBCAD0D9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7BB7EF5-EBA5-45F2-903F-9A0DBCAD0D9C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static partial UserUnmappedProperties GetUserUnmappedProperties(IMapper
{
return new UserUnmappedProperties()
{

};
}
}
Expand All @@ -56,4 +56,57 @@ private static partial UserUnmappedProperties GetUserUnmappedProperties(IMapper
public partial class DocumentDto {
public string Title { get; set; }
public string Content { get; set; }
}
}

/*
*Generated files
*
* UserReadDto.g.cs
* ```cs
*
* <auto-generated/>
using System;
using System.Collections.Generic;

using TenJames.CompMap.Mappper;

namespace TenJames.CompMap.Example;

partial class UserReadDto
{

///<summary>
/// The following properties were not mapped because they do not exist in the target class
///</summary>
internal class UserUnmappedProperties
{
/// <summary>
/// Found at /Entitities.cs at 29
/// </summary>
public required string Title { get; set; }
}

private static partial UserUnmappedProperties GetUserUnmappedProperties(IMapper mapper, User source);

/// <summary>
/// Mapping method generated by TenJames.CompMap
/// </summary>
public static UserReadDto MapFrom(IMapper mapper, User source)
{
// Note: Some properties were not mapped due to missing counterparts in the target class.
var unmapped = GetUserUnmappedProperties(mapper, source);
return new UserReadDto
{
Id = source.Id,
Name = source.Name,
Guid = source.Guid,
Documents = mapper.Map<ICollection<DocumentDto> >(source.Documents),
Title = unmapped.Title,
};
}
}
* ```
*
* Others follow similar pattern
*
*/
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\TenJames.CompMap\TenJames.CompMap\TenJames.CompMap.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\TenJames.CompMap\TenJames.CompMap.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion TenJames.CompMap/TenJames.CompMap/TenJames.CompMap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<PropertyGroup>
<Version>0.1.5</Version>
<Version>0.1.6</Version>
<Title>Compiletime Mapper</Title>
<Description>Map your object on compile time</Description>
<PackageProjectUrl>https://github.com/Ten-James/CompMap</PackageProjectUrl>
Expand Down