Git Product home page Git Product logo

cleanarchitecturecodegenerator's Introduction

Code Generator for Clean Architecture

Build Visual Studio Marketplace Version (including pre-releases) Visual Studio Marketplace Downloads

Download the extension

VS Marketplace

Open VSIX Gallery

image image

How to start

2022.mp4
-------------------------------------------------

A Visual Studio extension for easily create application features code to clean architecture project. Simply hit Shift+F2 to create an empty file in the selected folder or in the same folder as the selected file.

See the changelog for updates and roadmap.

Features

  • Easily create following application features code
  • {nameofPlural}/Commands/AddEdit/AddEdit{name}Command.cs
  • {nameofPlural}/Commands/AddEdit/AddEdit{name}CommandValidator.cs
  • {nameofPlural}/Commands/Create/Create{name}Command.cs
  • {nameofPlural}/Commands/Create/Create{name}CommandValidator.cs
  • {nameofPlural}/Commands/Delete/Delete{name}Command.cs
  • {nameofPlural}/Commands/Delete/Delete{name}CommandValidator.cs
  • {nameofPlural}/Commands/Update/Update{name}Command.cs
  • {nameofPlural}/Commands/Update/Update{name}CommandValidator.cs
  • {nameofPlural}/Commands/Import/Import{name}Command.cs
  • {nameofPlural}/Commands/Import/Import{name}CommandValidator.cs
  • {nameofPlural}/DTOs/{name}Dto.cs
  • {nameofPlural}/EventHandlers/{name}CreatedEventHandler.cs
  • {nameofPlural}/EventHandlers/{name}UpdatedEventHandler.cs
  • {nameofPlural}/EventHandlers/{name}DeletedEventHandler.cs
  • {nameofPlural}/Queries/Export/Export{nameofPlural}Query.cs
  • {nameofPlural}/Queries/GetAll/GetAll{nameofPlural}Query.cs
  • {nameofPlural}/Queries/Pagination/{nameofPlural}PaginationQuery.cs

CleanArchitecture for Blazor Server Application project

Please use this in collaboration with this project.

Github :https://github.com/neozhu/RazorPageCleanArchitecture Clean Architecture With Blazor Server

How to use

A new button is added to the context menu in Solution Explorer.

Add new file dialog

You can either click that button or use the keybord shortcut Shift+F2.

Select Entity Name from Domain Project

Add new file dialog

Create folders and namespace

Create additional folders for your file by using forward-slash to specify the structure.

For example, by typing scripts/test.js in the dialog, the folder scripts is created if it doesn't exist and the file test.js is then placed into it.

Generate sourcecode

Source code for application features

Generate to-do list

to-do list

code templates

You can modify these templates according to your own projects tempaltes

Contribute

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

License

Apache 2.0

cleanarchitecturecodegenerator's People

Contributors

neozhu avatar ra1d7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cleanarchitecturecodegenerator's Issues

New template files are not working

Hello, I made improvements on the repo. However, the files I added to the template are not coming. Existing and updated templates are succeed, but new files are not coming.

I deleted the files in AppData\Local\Microsoft\VisualStudio\17.0_e4823135Exp\Extensions.
I deleted the bin and obj folders in the project.
I did clean and rebuild, but the new templates are not coming.
And i tried debug and release but not ok.

Did you encounter this problem?

Please Update Incompatible VS 2022 Clean Architecture CodeGenerator Extension

Hi,

This is Leslie from the Visual Studio Extensibility team. I’m reaching out to you because we’ve received the following, high-priority feedback ticket for VS 2022: Visual Studio Feedback

We determined that this issue is the result of extension(s) not being updated to Visual Studio 2022 properly due to marking VS 2022 as compatible in the VSIX manifest but not referencing the new SDK PIA (Microsoft.VisualStudio.Interop.dll) and dependencies. We’ve identified that one of your extensions contributes to this issue:

Clean Architecture CodeGenerator

We strongly recommend that you update and re-publish your VSIX with the new VS 2022-compatible references, including EnvDTE.

Our investigation of the existing issue is that this happens when VS 2015 and VS 2022 are installed side by side, which is why it only occurred for a subset of customers. Nevertheless, referencing older versions of VSSDK assemblies is not supported, especially for the APIs and types that we’ve listed as breaking or altered. If you are doing so and find that your extensions work today, we make no guarantees that they will continue to work in the future. Extension authors could also find themselves in a situation where their extensions negatively impacts users due to untested workflows. From the product team’s perspective, we do not promise support to extension authors who do not follow our recommendation, and reference older versions of VSSDK. We also reserve the right to mark these extensions as incompatible should we find that VS is negatively affected by them. For the time being, instead of making VSIXValidator hard block any extensions that reference older assemblies, we will do a soft block and warn extension owners. And since this particular scenario is niche enough that it only affects side by side installs, we will not be marking them as incompatible, yet.

We will be pushing out changes in the coming months to warn both extension authors as well as extension consumers if they are creating or using an extension that are built with older versions of the VSSDK. We will share more details about this in the future.

Q: How can I validate whether my extension has dependencies on the old PIAs assembly?
A: You can try to validate the extension’s reference by following the steps below

  1. Open the Developer command prompt.
  2. Run the command ildasm as below.
    • C:>ildasm /text "{Extension Assembly}.dll" /output:result.txt
  3. Check for references in the result.txt file.

For more info on how to migrate your extension to VS 2022 successfully, please view the following resources:
Update Your Visual Studio Extension
Breaking API List
Migrated PIA List

Please let us know if you have any questions.

Leslie Richardson
Program Manager – Visual Studio
[email protected] | @lyrichardson01

HRESULT E_FAIL

Hi @neozhu,
After updating my VS 2022 to version 17.2.2
image

I'm getting this error.

image

Any help how to fix this?

Blazor or Razor?

This works as expected under the CA:Blazor project but not the CA:Razor which is in the readme description.

Does not pick up models

I've tried running the extension and I'm having an issue with it recognizing the models I have in the project. It only seems to find the TODO models that were already in the project template. I've confirmed these other models are correct and work as expected. Am I missing something?

Net 8/9 lts

Hello it looks like some of the nugets and run time targets are old.

Also how to have the commands show up on the HTML side when you right click on the entity or the menu item for managing that entity

Error while scaffolding new class

Hi,
I am using CleanArchitectureWithBlazorServer-1.0-preview.6 to create a project.
Changing the default project and run, will encounter some errors, but after replacing this line
@using Blazor.Server.UI.Services.JsInterop;
with this
@using Server.UI.Services.JsInterop;
The three errors will disappear. Then run the program with no errors.

By using CleanArchitecture CodeGenerator For Blazor App extension,
tried to add new entity such as

namespace TestCleanArchitecture.Domain.Entities;
public class Student : BaseAuditableEntity
{
public string? Name { get; set; }
public string? Semester { get; set; }
public DateOnly BirthDate { get; set; }
}

While scaffolding the Student class, I have received the following errors:

Error CS0246 The type or namespace name 'CleanArchitecture' could not be found (are you missing a using directive or an assembly reference?) Server.UI C:\test\TestCleanArchitecture\src\Server.UI\Pages\Students\Components\StudentFormDialog.razor 1 Active

Error CS1061 'IApplicationDbContext' does not contain a definition for 'Students' and no accessible extension method 'Students' accepting a first argument of type 'IApplicationDbContext' could be found (are you missing a using directive or an assembly reference?) Application C:\test\TestCleanArchitecture\src\Application\Features\Students\Commands\AddEdit\AddEditStudentCommand.cs 63 Active

Error (active) CS0117 'Permissions' does not contain a definition for 'Students' Server.UI C:\test\TestCleanArchitecture\src\Server.UI\Pages\Students\Students.razor 16

Could you kindly check what was wrong.

Thank you.

Errors generated after use

I need to do a better test and this was my first go at it. I did install the extension from my compile and didn't download from the Marketplace. (Though made no changes)

I created an entity and then ran the code gen for it created the following issue areas

Needed changes to IApplicationDbContext/ApplicationDbContext was completely unhandled.
Needed changes to Permissions was completely unhandled.

MudMenu.Direction and MusMenu.OffsetX seem to be obsolete? (Suggests AcchorOrigin or TransformOrigin instead)

Thanks

Edit:
Also the Oncreate function has an error, not had a chance to really debug it yet though I do think it is due to constants and localization at first glance. Issue turned out to be the exception being thrown intentionally because I need to handle the validation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.