Giter Club home page Giter Club logo

blazorhero-helper's People

Contributors

gozilla-paradise avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blazorhero-helper's Issues

AddEdit logic might not be right?

Hi there,

I was looking at the logic when you want to save, the code you generate is as follows:
Application//commands/AddEditCommand

public async Task<Result<int>> Handle(AddEditTeamCommand command, CancellationToken cancellationToken)
        {
            if (await _unitOfWork.Repository<Team>().Entities.Where(s => s.Id != command.Id).AnyAsync(cancellationToken: cancellationToken))
            {
                return await Result<int>.FailAsync("Record is already existed");
            }

            if (command.Id == 0)
            {
                var record = _mapper.Map<Team>(command);
                await _unitOfWork.Repository<Team>().AddAsync(record);
                await _unitOfWork.Commit(cancellationToken);
                return await Result<int>.SuccessAsync(record.Id, "Create Record Successfully");
            }
            else
            {

Notice if you are going to save an item, then the command id = 0, and obviously no entry in the database will have a 0 therefore it will always return with "Record is already existed". Maybe that logic needs to change a little? Or is that meant to be changed to something like Name so you can check if the name exists in the database? If it's the latter, you might want to check == as opposed to != ?

Bug in Permission

Hello ,

Search permission template has a bug, you can edit as follow;

public static class $_ENTITY_$s
        {
            public const string View = ""Permissions.$_ENTITY_$s.View"";
            public const string Create = ""Permissions.$_ENTITY_$s.Create"";
            public const string Edit = ""Permissions.$_ENTITY_$s.Edit"";
            public const string Delete = ""Permissions.$_ENTITY_$s.Delete"";
            public const string Search = ""Permissions.$_ENTITY_$s.Search"";
        }";

Entity Id type other than int

Hi there,

Firstly a great project, excellent tool.

I was wondering if you could have an additional field where you can specify the entity Id type. In my particular case the database I have is using a long instead of an int. All the generated code seems to be using a int by default.

Namespace directory added twice (sort of)

Maybe I changed it or maybe my code was generated with a different BH version but the namespace directory seems to be added twice:
Namespace: MyProgram
MyProgram.Application.Features.MyProgram.EmployeeCalendars.Commands.AddEdit
Under my solution I only have
MyProgram.Application.Features.EmployeeCalendars.Commands.AddEdit
The same with Domain, ClientInfrastructure, and others.

If no one else complains then ignore this, I must be an anomaly.

Thanks though, it looks great.

Craig

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.