Cast Form is a simple library built to solve problem to map an object to another.
First, configure Cast Form to know the types you want to map, in the startup of your application:
var mapper = new MapperBuilder()
.AddMapper<Foo, FooDto>()
.AddMapper<Bar, BarDto>()
.Build();
Then in your application code, execute the mappings:
var fooDto = mapper.Map<FooDto>(foo);
var barDto = mapper.Map<BarDto>(bar);
Via terminal:
dotnet add package CastForm
Via nuget, install NuGet. Then, install Cast Form from the package manager console:
PM> Install-Package CastForm
- Not support expression
You might want to know exactly what your mapping does at runtime.
If you're still running into problems, file an issue above.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct and contributors under the MIT license.