async create(entity) {
                this.#setDAOs(entity);
                let result = new Result();
                let nmClass = entity.constructor.name;
                let msg = await this.#executeRules(entity, "Create")
                if (msg == undefined) {
                    let dao = this.#daos.get(nmClass);
                    try {
                        await dao.create(entity);
                    } catch (err) {
                        console.log(err);
                    };
                }
                else {
                    result.setMsg(msg);
                };
                return result;
            }
//Execute the validation rules and call the respective DAO of the entity, to save the entity in the DataBase
Execute the validation rules and call the respective DAO of the entity, to save the entity in the DataBase
Execute the validation rules and call the respective DAO of the entity to save the entity in the DataBase
async create(entity) {
                this.#setDAOs(entity);
                let result = new Result();
                let nmClass = entity.constructor.name;
                let msg = await this.#executeRules(entity, "Create")
                if (msg == undefined) {
                    let dao = this.#daos.get(nmClass);
                    try {
                        await dao.create(entity);
                    } catch (err) {
                        console.log(err);
                    };
                }
                else {
                    result.setMsg(msg);
                };
                return result;
            }
async create ( entity ) { this . #setDAOs ( entity ) ; let result = new Result ( ) ; let nmClass = entity . constructor . name ; let msg = await this . #executeRules ( entity , "Create" ) if ( msg == undefined ) { let dao = this . #daos . get ( nmClass ) ; try { await dao . create ( entity ) ; } catch ( err ) { console . log ( err ) ; } ; } else { result . setMsg ( msg ) ; } ; return result ; }
Execute the validation rules and call the respective DAO of the entity, to save the entity in the DataBase
Execute the validation rules and call the respective DAO of the entity to save the entity in the DataBase