MapsterMapper / MapsterMapper/Mapster
mapster tool generates non-public interface method/property implementation
Open
@andrerav is already working on this.
Since Feb 18, 2022.
bug
help wanted
- Dominant language
- C#
- Stars
- 5.2k
- Forks
- 410
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
When generating mapper from interface containing mapping method/property with internal classes mapster tool generates internal implementation of this method/property
- Mapster.Core v1.2.0
- mapster.tool v8.2.1
- executed on
net5
[Mapper(IsInternal = true)]
internal interface IMyMappers
{
PocoDto Map(Poco source);
Expression<Func<Poco, PocoDto>> ProjectToDto { get; }
}
public record Poco(string Name, string Description);
internal record PocoDto(string Name, string Description);
Generated mapper class is:
internal partial class MyMappers : IMyMappers
{
internal Expression<Func<Poco, PocoDto>> ProjectToDto => p1 => new PocoDto(p1.Name, p1.Description);
internal PocoDto Map(Poco p2)
{
return p2 == null ? null : new PocoDto(p2.Name, p2.Description);
}
}
CS0737: 'MyMappers.Map(Poco)' cannot implement an interface member because it is not public.
CS0737: 'MyMappers.ProjectToDto' cannot implement an interface member because it is not public.
Maybe internal class with proper implementations should be generated even in case MapperAttribute.IsInternal hasn't been specified
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.