<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>C# on A #dataOp ramblings</title><link>https://fpvmorais.com/tags/c%23/</link><description>Recent content in C# on A #dataOp ramblings</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 09 Apr 2022 16:45:00 +0100</lastBuildDate><atom:link href="https://fpvmorais.com/tags/c%23/index.xml" rel="self" type="application/rss+xml"/><item><title>Accessing local settings while unit testing Azure Functions</title><link>https://fpvmorais.com/post/azure_functions_unit_testing/</link><pubDate>Sat, 09 Apr 2022 16:45:00 +0100</pubDate><guid>https://fpvmorais.com/post/azure_functions_unit_testing/</guid><description>&lt;p&gt;There&amp;rsquo;s a lot to chew while unit testing Azure Functions. I going to
be quite liberal with the terminology because technically some of
this will be in fact integration testing and not unit testing per se.&lt;/p&gt;
&lt;p&gt;Either way, Azure Functions load the &lt;code&gt;local.settings.json&lt;/code&gt; on
startup, creating several environment variables that then we can use
in our code. In &lt;code&gt;C#&lt;/code&gt; we would access them like so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;tenantId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;configRoot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;TenantId&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;appId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;configRoot&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;AppId&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or in &lt;code&gt;Python&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>EzApi - Define flat file columns from connection string</title><link>https://fpvmorais.com/post/ezapi_define_columns_flat_file/</link><pubDate>Thu, 25 Apr 2019 16:08:33 +0100</pubDate><guid>https://fpvmorais.com/post/ezapi_define_columns_flat_file/</guid><description>&lt;h1 id="so-whats-new"&gt;So what&amp;rsquo;s new?&lt;/h1&gt;
&lt;p&gt;Thanks to the contribution via GitHub from &lt;a href="https://github.com/HadiFadl"&gt;Hadi
Fadl&lt;/a&gt; there&amp;rsquo;s a new method available for
the flat file connection manager that adds the existing columns in the
source file. This is very handy because in the past you would have to
define each and every column that existed in the flat file.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve updated the &lt;a href="https://www.nuget.org/packages/EzAPI/"&gt;nuget&lt;/a&gt; to version 0.8.93.&lt;/p&gt;
&lt;p&gt;Please give me your feedback of anything you might think should be improved.&lt;/p&gt;</description></item><item><title>EzApi - Adding Event Handlers</title><link>https://fpvmorais.com/post/ezapieventhandler/</link><pubDate>Tue, 19 Jun 2018 09:16:56 +0100</pubDate><guid>https://fpvmorais.com/post/ezapieventhandler/</guid><description>&lt;h2 id="how-to-add-event-handlers-to-generated-packages"&gt;How to add event handlers to generated packages&lt;/h2&gt;
&lt;p&gt;I had a request to give an example of adding event handlers to a generated SSIS package. The code is quite convoluted. There&amp;rsquo;s no method to initialize a &lt;code&gt;DtsEventHandler&lt;/code&gt;, you need to cast it after adding to the package with a &lt;code&gt;String&lt;/code&gt; describing the type of event. Here&amp;rsquo;s a list of the available events:&lt;/p&gt;
&lt;p&gt;&lt;img alt="List of event types" loading="lazy" src="https://fpvmorais.com/eventHandlerOptions.png"&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a sample of how to do insert a &lt;code&gt;ExecuteSQLTask&lt;/code&gt; to a event handler using a small console application:&lt;/p&gt;</description></item></channel></rss>