CodeGenerator
See original GitHub issueIssue fixed by cloning the other repo and building it after instructions from @neozhu
Still extremly happy with the project. I’m trying to use the codegenerator (yes i know it’s on different github repo). I’ve installed vs 2022 community edition and when I generate stuff for any class i’ve is that it isn’t compilable after.
In the DTO’s mapFrom
is used and that isn’t the case in this source code.
Code it generates:
public class SoftwareDto:IMapFrom<Software>
{
public void Mapping(Profile profile)
{
profile.CreateMap<Software, SoftwareDto>().ReverseMap();
}
// TODO: define data transfer object (DTO) fields, for example:
[Description("Id")]
public int Id {get;set;}
[Description("Name")]
public string Name {get;set;} = String.Empty;
[Description("Description")]
public string? Description {get;set;}
}
ProductDTO in this repo is like:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace myapp.Application.Features.Products.DTOs;
[Description("Products")]
public class ProductDto
{
[Description("Id")] public int Id { get; set; }
[Description("Product Name")] public string? Name { get; set; }
[Description("Description")] public string? Description { get; set; }
[Description("Unit")] public string? Unit { get; set; }
[Description("Brand Name")] public string? Brand { get; set; }
[Description("Price")] public decimal Price { get; set; }
[Description("Pictures")] public List<ProductImage>? Pictures { get; set; }
private class Mapping : Profile
{
public Mapping()
{
CreateMap<Product, ProductDto>().ReverseMap();
}
}
}
MapFrom is used in multiple files it generates so its a little bit of cleaning up to make use of it.
It’s still quite a headstart to use the generator. But could you take a look and see what’s wrong compared to project here?
Issue Analytics
- State:
- Created 2 months ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
QR Code Generator | Create Your Free QR Codes
QR Code Generator for URL, vCard, and more. Add logo, colors, frames, and download in high print quality. Get your free QR Codes...
Read more >Code Generator | CodePal - The Ultimate Coding Companion
Code generation is the process of automatically creating computer source code from a higher-level representation, such as a design specification, a graphical ...
Read more >Free Random Codes Generator
Use Voucherify free code generator to generate unique codes that can be used for coupons, gift cards, passwords, and more.
Read more >QR Code Generator
Free Online QR Code Generator to make your own QR Codes. Supports Dynamic Codes, Tracking, Analytics, Free text, vCards and more.
Read more >CodeGenerator Class (System.CodeDom.Compiler)
Code generators are capable of rendering source code in a specific language according to the structure of a Code Document Object Model (CodeDOM)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://www.vsixgallery.com/extension/6A168388-B6A2-42F9-BA5A-B577D3CD4DB5
@neozhu you’re amazing !