public static Brand Execute(IRegisterNewBrandRequest request) { try { return(BrandFactory.MakeBrand(request)); } catch (Exception e) { throw e; } }
public static async Task RegisterNewBrand(IRegisterNewBrandRequest request) { try { var brand = CreateNewBrand.Execute(request); await BrandEntity.ValidateNew(brand); await RegisterBrand.Execute(brand); } catch (Exception e) { throw e; } }
public static Brand MakeBrand(IRegisterNewBrandRequest request) { try { return(new Brand() { Name = request.Name, Abbreviation = request.Abbreviation, Cnpj = BrandEntity.NormilizeCnpj(request.Cnpj) }); } catch (Exception e) { throw e; } }