profile
viewpoint

cezarypiatek/MappingGenerator 699

:arrows_counterclockwise: "AutoMapper" like, Roslyn based, code fix provider that allows to generate mapping code in design time.

cezarypiatek/CSharpExtensions 45

A set of annotations and analyzers that add additional constraints to your codebase

cezarypiatek/CsharpMacros 42

A simple template base system of macros for C# that can be executed in design time

cezarypiatek/DependencyGraph 17

A small F# application to visualize .net assembly dependencies

cezarypiatek/DDDToolbox 14

A set of Roslyn refactorings supporting DDD design

cezarypiatek/ArchitecturalPatterns 12

Link aggregator of architectural patterns implementation

cezarypiatek/CQRSsnippets 4

Resharper Live Templates for CQRS described in https://cezarypiatek.github.io/post/cqrs-snippets/

cezarypiatek/clean-code-dotnet 3

:bathtub: Clean Code concepts and tools adapted for .NET

startedcezarypiatek/MappingGenerator

started time in 9 hours

created repositoryspetz/mm-workshops

created time in 11 hours

created repositoryspetz/asp-workshops

created time in 11 hours

startedcezarypiatek/MappingGenerator

started time in 11 hours

issue commentcezarypiatek/MappingGenerator

Source Generators

@cezarypiatek I just found this repo because it has the same name as my own - I have been exploring source generators to implement a Map method for a couple weeks now at this repo, if you're interested. Mind you its not quite ready for production. I guess I'll have to find a different name before I start publishing it as a NuGet package :) I'll be interested to see what you come up with if you get past the blocker.

MatthewSteeples

comment created time in 11 hours

fork anhnh305/MappingGenerator

:arrows_counterclockwise: "AutoMapper" like, Roslyn based, code fix provider that allows to generate mapping code in design time.

https://marketplace.visualstudio.com/items?itemName=54748ff9-45fc-43c2-8ec5-cf7912bc3b84.mappinggenerator

fork in 2 days

startedcezarypiatek/MappingGenerator

started time in 4 days

startedcezarypiatek/CSharpExtensions

started time in 4 days

issue closedcezarypiatek/MappingGenerator

Generate unit tests

I know that this issue is a little out of the scope of this project. I've seen https://github.com/cezarypiatek/MappingGenerator/issues/131.

I wanted to change AutoMapper to MappingGenerator but I have one blocker. I have many profiles in my program (the same situation is in many other projects in my company) and I have one unit test that checks the validation of mapping

           foreach (var profile in profiles)
            {
                var mapperConfig = new MapperConfiguration(cfg => { cfg.AddProfile(profile); });
                try
                {
                    mapperConfig.AssertConfigurationIsValid();
                }
                catch (AutoMapperConfigurationException ex)
                {
                    // I know that there is a problem
                }
            }

If someone adds a property to an object, the test will show him an error. I can't reproduce this behavior with MappingGenerator without creating a unit test for each mapping. But it requires a lot of work and the reviewer have to check if the test is added.

So if I have junior devs in my team I prefer to stay with AutoMapper with its disadvantages (I know it is slow, it is hard to debug, IDE doesn't show references of property) but I know that mappings are ok (or it is highly probable)

Any ideas on how to automate it?

closed time in 6 days

WojciechNagorski

issue commentcezarypiatek/MappingGenerator

Generate unit tests

Yes, We can close this issue. But I'm not sure if this solution is enough. I need to try it.

WojciechNagorski

comment created time in 6 days

startedcezarypiatek/MappingGenerator

started time in 8 days

startedcezarypiatek/MappingGenerator

started time in 8 days

fork adamsitnik/SudokuSpice

A Sudoku solving library written in .NET Core.

fork in 8 days

issue commentcezarypiatek/MappingGenerator

Source Generators

I am a newbie, so forgive me if this does not help. I found this example, that uses syntaxfactory:

https://carlos.mendible.com/2017/03/02/create-a-class-with-net-core-and-roslyn/

The code looks ok, maybe the example could help you if you wanted to change to Syntaxfactory?

I am very new to coding and like your mapping generator a lot, so would love it to work as a source generator.

MatthewSteeples

comment created time in 8 days

issue openedcezarypiatek/MappingGenerator

Suggestion: Varying sample data

Today the sample data generated is the same every time. In order to have some more realistic testing data it would be nice to have this sample data vary a bit every time it is generated.

I am using Rider nuget.

created time in 8 days

startedcezarypiatek/MappingGenerator

started time in 8 days

startedcezarypiatek/MappingGenerator

started time in 8 days

startedcezarypiatek/MappingGenerator

started time in 9 days

startedcezarypiatek/MappingGenerator

started time in 9 days

fork ArthurYiL/CSharpExtensions

A set of annotations and analyzers that add additional constraints to your codebase

fork in 10 days

issue openedcezarypiatek/MappingGenerator

Suggestion: Scaffold invocation on multiple lines.

The existing feature is really great and useful. Any chance we can get some styling while scaffolding? Something similar to the usage below. Basically, the ability to scaffold arguments on separate lines.

public AddressDto GetAddress1()
{
    return new AddressDto(street: "lorem ipsum", city: "lorem ipsum", country: "lorem ipsum");
}

public AddressDto GetAddress2()
{
    return new AddressDto
    (
        street: "lorem ipsum",
        city: "lorem ipsum",
        country: "lorem ipsum"
    );
}

I'm not familiar with VS extension eco-system, so I have no idea if this is a trivial thing, or if it requires substantial effort. I just think would be a really nice feature to have. At least in my perspective :)

created time in 10 days

startedcezarypiatek/MappingGenerator

started time in 12 days

issue openedcezarypiatek/MappingGenerator

Generate unit tests

I know that this issue is a little out of the scope of this project. I've seen https://github.com/cezarypiatek/MappingGenerator/issues/131.

I wanted to change AutoMapper to MappingGenerator but I have one blocker. I have many profiles in my program (the same situation is in many other projects in my company) and I have one unit test that checks the validation of mapping

           foreach (var profile in profiles)
            {
                var mapperConfig = new MapperConfiguration(cfg => { cfg.AddProfile(profile); });
                try
                {
                    mapperConfig.AssertConfigurationIsValid();
                }
                catch (AutoMapperConfigurationException ex)
                {
                    // I know that there is a problem
                }
            }

If someone adds a property to an object, the test will show him an error. I can't reproduce this behavior with MappingGenerator without creating a unit test for each mapping. But it requires a lot of work and the reviewer have to check if the test is added.

So if I have junior devs in my team I prefer to stay with AutoMapper with its disadvantages (I know it is slow, it is hard to debug, IDE doesn't show references of property) but I know that mappings are ok (or it is highly probable)

Any ideas on how to automate it?

created time in 12 days

startedcezarypiatek/MappingGenerator

started time in 13 days

startedcezarypiatek/MappingGenerator

started time in 13 days

startedcezarypiatek/MappingGenerator

started time in 13 days

fork anthrax3/RazorGenerator

A Custom Tool for Visual Studio that allows processing Razor files at design time instead of runtime, allowing them to be built into an assembly for simpler reuse and distribution.

fork in 14 days

fork anthrax3/CsharpMacros

A simple template base system of macros for C# that can be executed in design time

fork in 14 days

startedcezarypiatek/CsharpMacros

started time in 14 days

more