Exemplo n.º 1
0
        public async Task <int> InsertAsync(CountryInfo assistenceInfo)
        {
            string insertQuery = "INSERT INTO CountryInfo VALUES(@Access, @GeneralInformation, @HagueAbductionConvention, @Return, @Attorney, @Mediaton)";

            int id = await connection.ExecuteAsync(insertQuery, assistenceInfo);

            return(id);
        }
Exemplo n.º 2
0
        public async Task <int> InsertAsync(Country country)
        {
            int assistanceInfoId = await this.assistenceInfoRepository.InsertAsync(country.AssistenceInfo);

            int countryInfoId = await this.countryInfoRepository.InsertAsync(country.CountryInfo);

            string insertQuery = "INSERT INTO Countries VALUES(@Name, @Code, @AssistenceInfoId, @CountryInfoId)";

            var parameters = new
            {
                Name             = country.Name,
                Code             = country.Code,
                AssistenceInfoId = assistanceInfoId,
                CountryInfoId    = countryInfoId
            };

            return(await connection.ExecuteAsync(insertQuery, parameters));
        }
        public async Task <int> InsertAsync(AssistenceInfo assistenceInfo)
        {
            string insertQuery = "INSERT INTO AssistenceInfo VALUES(@Email, @Fax, @Phone, @Globe, @Title)";

            return(await connection.ExecuteAsync(insertQuery, assistenceInfo));
        }