//public async Task<ICommandResult> Handle(VendorRegisterCommand mesage)
        //{
        //    try
        //    {
        //        Vendor vendor = new Vendor(mesage.Version);
        //        vendor.Register(mesage);
        //        await _vendorService.AddToDb(vendor);
        //        ICommandResult result = new CommandResult()
        //        {
        //            Message = "",
        //            ObjectId = vendor.Id,
        //            Status = CommandResult.StatusEnum.Sucess
        //        };
        //        return result;
        //    }
        //    catch (Exception e)
        //    {
        //        e.Data["Param"] = mesage;
        //        ICommandResult result = new CommandResult()
        //        {
        //            Message = e.Message,
        //            Status = CommandResult.StatusEnum.Fail
        //        };
        //        return result;
        //    }
        //}

        public async Task <ICommandResult> Handle(VendorAddCommand mesage)
        {
            try
            {
                Vendor vendor = new Vendor(mesage.Version);
                vendor.Add(mesage);
                await _vendorService.AddToDb(vendor);

                ICommandResult result = new CommandResult()
                {
                    Message  = "",
                    ObjectId = vendor.Id,
                    Status   = CommandResult.StatusEnum.Sucess
                };
                return(result);
            }
            catch (Exception e)
            {
                e.Data["Param"] = mesage;
                ICommandResult result = new CommandResult()
                {
                    Message = e.Message,
                    Status  = CommandResult.StatusEnum.Fail
                };
                return(result);
            }
        }