Example #1
0
        public async Task <Response> ImportAsync(ImportGasStationRequestMessage requestMessage)
        {
            var response = Response.Create();

            if (requestMessage == null)
            {
                return(response.WithBusinessError("Registros inválidos"));
            }

            var createGasStationsResponse = await CreateGasStationsAsync(requestMessage.GasStations.ToGasStationsDto());

            if (createGasStationsResponse.HasError)
            {
                return(response.WithMessages(createGasStationsResponse.Messages));
            }

            return(response);
        }
 protected override void BeforeCreateService()
 {
     _requestMessage = ImportGasStationRequestMessageFake();
 }