YonatanCohavi / DynamicsMapper

MIT License
0 stars 0 forks source link

Does not work if new namespace syntax #1

Closed ignatandrei closed 1 year ago

ignatandrei commented 1 year ago

If we have

namespace NextGenMapperDemo
{
    [CrmEntity("person")]
    public class Person

it generates the files. However , if we write

namespace NextGenMapperDemo;
[CrmEntity("person")]
public class Person
{

it does not generated

I think that the problems resides here

var @namespace = mapperSyntax.GetParent<NamespaceDeclarationSyntax>()!.Name.ToString();
var mapperNameSpace = mapperSyntax.GetParent<NamespaceDeclarationSyntax>()!.Name.ToString();

I believe that should be BaseNamespaceDeclarationSyntax

https://learn.microsoft.com/en-us/dotnet/api/microsoft.codeanalysis.csharp.syntax.basenamespacedeclarationsyntax

( I want to add to my list of Roslyn Source Code Generators from https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG )

YonatanCohavi commented 1 year ago

thanks for the input. It will be fixed soon.

ignatandrei commented 1 year ago

Thanks ! - it is now at https://ignatandrei.github.io/RSCG_Examples/v2/docs/DynamicsMapper