public async Task <int> CrearUbicacionAsync(UbicacionEntity entity) { if (_dbConnection.State == ConnectionState.Closed) { _dbConnection.Open(); } var spEntity = new { entity.IdAnuncio, entity.Direccion, Latitud = Math.Round(entity.Latitud, 6), Longitud = Math.Round(entity.Longitud, 6) }; var result = await _dbConnection.QueryAsync <int>("CrearUbicacion", spEntity, commandType : CommandType.StoredProcedure); _dbConnection.Close(); return(result.FirstOrDefault()); }
public async Task <bool> EditarUbicacionAsync(UbicacionEntity entity) { if (_dbConnection.State == ConnectionState.Closed) { _dbConnection.Open(); } var spEntity = new { entity.IdUbicacion, entity.IdAnuncio, entity.Direccion, entity.Latitud, entity.Longitud }; var result = await _dbConnection.QueryAsync <bool>("EditarUbicacion", spEntity, commandType : CommandType.StoredProcedure); _dbConnection.Close(); return(result.FirstOrDefault()); }