Azure function–solving my own code problems–part 35

1. My fault – the plugins does not exists in output

this should be added to the output in order to the plugins to be copied to the output directory

<ItemGroup>
<None Remove=”plugins\” />
<Content Include=”plugins\**\*.dll” CopyToOutputDirectory=”Always” />
</ItemGroup>

2. Deploying  , I should see what it is convenient: context.FunctionDirectory  OR context.FunctionAppDirectory

log.LogInformation($”!!! C# Timer trigger function executed at: {DateTime.Now} next {myTimer.FormatNextOccurrences(1)} “);
var folder = Path.Combine(context.FunctionDirectory, “plugins”);
log.LogInformation($”!!! Folder {folder} Folder exists: {Directory.Exists(folder)}”);

folder = Path.Combine(context.FunctionAppDirectory, “plugins”);
log.LogInformation($”!!!Folder {folder} Folder exists: {Directory.Exists(folder)}”);

3. Plugins loading – missing dll’s

Because I work with Nate Mc Master Plugins  , https://github.com/natemcmaster/DotNetCorePlugins, I encounter the  error “ could not load file or assembly ‘System.Runtime.Loader, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

I was trying self-contained in building Azure  – does not publish the file ‘System.Runtime.Loader . But the InfoValutarLoadingLibs/InfoValutarLoadingLibs.csproj it does!

Solution : publish self contained loading libs, build azure function , copy files from loading libs to azure function project

4. Now encountering this one:

https://github.com/Azure/Azure-Functions/issues/1250

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Loading data regularly–deploy plugins–Azure Function–part 34

Now I have broken the build. Why ?Because of the docker file – to be optimized on local, I copy ecah csproj one by one and the I do dotnet restore. (If docker had a glob patttern! ) . So each time that I put a new project, the build will fail!

Trying now from the Azure Function to load the plugins . Apparently, the deploying does not deploy also the plugins ( Application Insights , connected to the Azure function ,is your friend – it can show you all kind of messages)

But now I have a problem copying the plugins. I do in azure Function like I have done with the other projects;

A post-build event

dotnet pwsh $(ProjectDir)preBuild.ps1 “$(RepoRoot)plugins\”  “$(TargetDir)”

and a file prebuild.ps1 file that says

echo “args 0 ”  $args[0]
echo “args 1 ” $args[1]
$a= Get-Location
echo $a
echo now copy
Copy-Item -Path $args[0] -Destination $args[1] -Recurse -Force

For all other projects it is working. For the azure function, it gives an error at the compiling time on CI ( not on local! )

/bin/sh: 3: /tmp/tmpdd44ee8bfe4f49dca815035fe3a451ee.exec.cmd: Syntax error: Unterminated quoted string

I found the problem

dotnet pwsh $(ProjectDir)preBuild.ps1 “$(RepoRoot)plugins\”  “$(TargetDir)”

Now, a different error raises on Github CI when compiling the Azure Function:

The specified framework ‘Microsoft.NETCore.App’, version ‘2.1.0’ was not found.

The problem  is here: https://github.com/Azure/azure-functions-vs-build-sdk/blob/master/src/Microsoft.NET.Sdk.Functions.MSBuild/Targets/Microsoft.NET.Sdk.Functions.targets 

<_FunctionsTaskFramework Condition=” ‘$(MSBuildRuntimeType)’ == ‘Core'”>netcoreapp2.1</_FunctionsTaskFramework>

I try to build into an netcoreapp3.0 docker container. I must install 2.1, probably.

For github actions:

– name: Setup .NET Core 2.1
       uses: actions/setup-dotnet@v1
       with:
         dotnet-version: 2.1.802

    – name: Setup .NET Core 3.0
       uses: actions/setup-dotnet@v1
       with:
         dotnet-version: 3.0.100

Not working!

But a new idea – what if I have the project not up-to-date  ? And indeed , the nuget for azure functions was not update. Now it works for GitHub actions!https://github.com/ignatandrei/InfoValutar/actions

Now , back to work  – I want to deploy the plugins in the Azure Function

Reading about ExecutionContext – ok. Reading about difference between FunctionAppDirectory and  FunctionDirectory  –https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function . Ok – I want FunctionDirectory – I think it is just for this function.

For uploading files and folder, there are 2 ideas:

  1. to have included in .csproj ( do not want the plugins to be included !)
  2. To include in the zip file https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push 

So CI / CD to the rescue. I will do in AzureDevOps – next time!

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Loading data at regular intervals–Azure function –part 33

I need to load data at scheduled intervals – it is normal that the exchange rates are published every day.

So what options we have in Azure?

  1. WebJobs
  2. Worker Roles
  3. Azure functions

After reading a lot, I decide on Azure Functions – it is the new kid on the block and battle tested. More, it has something called Durable , https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp that seems very promising

I create the function in the Azure Portal –  just account that creation is not milliseconds, but seconds. And be sure that you craete under the same resource group as the previous resources.

The I create the function project template in Visual Studio.  Trying to deploy from Visual Studio – after configuring , the endpoint on Azureshows error. Thinking  – guess the problem – I configured the endpoint with Linux – and on my PC I have Windows. Deleting and creating another one – with Windows Containers. And now an error:”Requested feature is not available in resource group infovalutarRG. Please try using a different resource group or create a new one”

No wonder why is a DevOps thing nowadays…

Going back to Visual Studio – figuring “ Publish” has an edit – and I can see there that I can select on what OS I can publish to. => error on deploy. Investigating the logs – not understanding the error ( not enough details)

Ok –  now I want to create the Azure Function from within Visual Studio. Let’s see. Now publishing works, the website show a nice interface ( your functions is up and running) . But , even if successfully deployed, does not show my function!

Trying to get the deployment profile from the Azure WebSite – says that it cannot find the function. However, it is just a time caching problem. Some seconds later it shows the function!

Moral : do not rush. Caching is a bitch nowadays.

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Try Dot Net–again–part 32

I wanted to put my project on the .NET try – it is a wonderful tool that makes magic for .NET . However, I wanted to be in a docker container. I have open a issue here: https://github.com/dotnet/try/issues/590

It was resolved  – now I can specify the port

But the problem now it is that cannot run the program ( ok, I have not a simple program)

But – the idea is that is not released yet the final version

So I decide to let it go – and wait for the new official release.

Moral: if you do not have time, do not work with anything other than the release versions…

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Saving multiple data–part 31

I want to load the exchange rates from NBR and ECB and load at once .From here, the challenges of programming for a simple task like this:

  1. How we can display the errors ?
  2. What if the data exists already for this day and I cannot save into database, because it exists ?
  3. How to acknowledge what exists and what not , in one operation ?
  4. How to report success even if data exists ? Should we report number of records?
  5.  How we can perform async all that stuff and, however , report errors ?

If you know the answer to all that, I have a challenge for you: see the file at https://github.com/ignatandrei/InfoValutar/blob/master/InfoValutar/InfovalutarLoadAndSave/LoadAndSaveLastData.cs– and improve it.

Until then, I come with this simple code

 

public class ResultsLoadBankData
    {
        public string Bank { get; internal set; }
        public int NrRecords { get; internal set; }
        public bool HasSuccess { get; internal set; }
        public string ErrorMessage { get; internal set; }
    }

//in some class below
public async Task<ResultsLoadBankData[]> LoadAndSave()
        {
            
            
            var items= providers.Banks().Select(it =>
                new KeyValuePair<string, ResultsLoadBankData>(it,
                new ResultsLoadBankData()
                {
                    Bank = it,
                    ErrorMessage=null,
                    HasSuccess=true,
                    NrRecords=0
                })
             );
            var lst = new Dictionary<string, ResultsLoadBankData>(items);


            var rates = 
                providers.LoadExchange()
                .Select(it => it.GetActualRates())
                .ToArray();
            //TODO: how to load async all async enumerables?
            //TODO: how to report error if one fails?
            foreach (var rateAsync in rates)
            {
                
                await foreach(var rate in rateAsync)
                {
                    var item = lst[rate.Bank];
                    try
                    {
                        
                        if (await ret.Exists(rate))
                            continue;
                        var nr = await save.Save(rate);
                        item.NrRecords++;
                    }
                    catch(Exception ex)
                    {
                        //TODO:log
                        item.ErrorMessage = ex.Message;
                        item.HasSuccess = false;
                    }
                }
                
                
            }
            return lst.Values.ToArray();
        }

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

EF Core identical tables and partial–part 30

Let’s suppose that you have 2 identical tables and you scaffold from the context the tables. It will give you 2 classes  – with the same properties. How can you make to work for the programmer as the same class, without modifying the models scaffolded by EF ?

Example – class Ecb and class Nbr from below are the same

public partial class Ecb
     {
         public string ExchangeFrom { get; set; }
         public string ExchangeTo { get; set; }
         public DateTime Date { get; set; }
         public decimal ExchangeValue { get; set; }
     }

public partial class Nbr
    {
        public string ExchangeFrom { get; set; }
        public string ExchangeTo { get; set; }
        public DateTime Date { get; set; }
        public decimal ExchangeValue { get; set; }
    }

public partial class InfoValutarContext : DbContext
    {
       

       public InfoValutarContext(DbContextOptions<InfoValutarContext> options)
            : base(options)
        {
        }

       public virtual DbSet<Ecb> Ecb { get; set; }
        public virtual DbSet<Nbr> Nbr { get; set; }

}

Answer:

Create an interface, add partials for the classes, add partial for context ( attention to namespaces)

public interface IExchangeRate
     {
         DateTime Date { get; set; }
         string ExchangeFrom { get; set; }
         string ExchangeTo { get; set; }
         decimal ExchangeValue { get; set; }
     }

public partial class Ecb: IExchangeRate
     {
     }
     public partial class Nbr : IExchangeRate
     {
     }

public partial class InfoValutarContext
     {
         public IQueryable<IExchangeRate> RateQ(string bank)
         {
             switch (bank?.ToLower())
             {
                 case “ecb”:
                     return this.Ecb.AsNoTracking();
                 case “bnr”:
                     return this.Nbr.AsNoTracking();
                 default:
                     throw new ArgumentException($”cannot find bank {bank}”);
             }
         }
     }

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Middleware for custom urls–part 29

The question was how I can now intercept calls like

www.infovalutar.ro/bnr/2004/10/10/EUR

www.infovalutar.ro/bnr/azi/eur

www.infovalutar.ro/2004/6/4/eur.bnr

http://www.infovalutar.ro/bnr/rss

? There is no controller ! So – middleware to help!

For reading about middleware, please see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-3.0

For rewriting, please see https://docs.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-3.0

Anyway, this is my code:

var service = app.ApplicationServices.GetService<LoadExchangeProviders>();
foreach (var item in service.Banks())
{
app.MapWhen(cnt =>
cnt.Request.Path.Value.StartsWith(“/” + item + “/”, StringComparison.InvariantCultureIgnoreCase)
||
cnt.Request.Path.Value.EndsWith(“.” + item, StringComparison.InvariantCultureIgnoreCase)
, HandleBank);
}

Figures also that previous answer was a string, not an object – changing return type to string

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Refactoring ,AzureConnectionString, rss, asmx–part 28

Now, I want to see that I can read from the database the exchange rates. For this, in Azure WebAPP I go to Settings => Configuration and add my connection string.

But now I have a problem: I must read from the configuration.  So back on DI with InMemory class – I inject from ASP.NET Core the Configuration and in the tests I construct directly with null.

IConfiguration configuration;

public InMemoryDB(IConfiguration config)
{
this.configuration = config;

}
private string GetConRead(string name)
{
return configuration?.GetConnectionString(name);
}

 

Also, for easy retrieving from URL , I modify from

public async Task<ExchangeRates[]> Rates(string bank,string fromDate, string toDate)

( that generates the url : https://infovalutar.azurewebsites.net/api/v1.0/FromDB/Rates?bank=bnr&fromDate=20010101&toDate=20500101 )

to

[HttpGet(“{bank}/{fromDate}/{toDate}”)]
public async Task<ExchangeRates[]> Rates([FromRoute] string bank, [FromRoute]string fromDate, [FromRoute]string toDate)

( that generates the URL: https://infovalutar.azurewebsites.net/api/v1.0/rates/bnr/20010101/20100101 )

 

( I have also modified the route on the controller to [Route(“api/v{version:apiVersion}/rates”)] )

The modifications are at https://github.com/ignatandrei/InfoValutar/commit/aeda74e071a333e800a36936d2d3fc685b4b3ac8 .

The bad part – the deploy takes now 7 minutes…( running tests first …)

I have to implement now the following (

www.infovalutar.ro/bnr/2004/10/10/EUR

www.infovalutar.ro/bnr/azi/eur

www.infovalutar.ro/2004/6/4/eur.bnr

http://www.infovalutar.ro/bnr/rss

http://infovalutar.ro/curs.asmx?wsdl

 

I will implement first into the rates API , then I will redirect.

For example, the first one is like this: www.infovalutar.ro/bnr/2004/10/10/EUR and www.infovalutar.ro/2004/6/4/eur.bnr can be implemented like this:

 

[HttpGet(“{year}/{month}/{day}/{exchange}.{bank}”)]
[HttpGet(“{bank}/{year}/{month}/{day}/{exchange}”)]
public async Task<ExchangeRates> RatesOnDate([FromRoute] string bank,
[FromRoute]int year, [FromRoute]int month,
[FromRoute] int day, [FromRoute] string exchange)

 

 

What about the rss ? There is a package called System.ServiceModel.Syndication in .NET Core  – and we can use for RSS like this:

[HttpGet(“{bank}/rss”)]
public async Task<IActionResult> GetRssFeed(string bank)
{
var data= await ret.TodayRates(bank);
var items = data
.Select(it =>
new SyndicationItem(
it.ExchangeTo,
it.ExchangeValue.ToString(),
new Uri($”http://www.infovalutar.ro/bnr/{it.Date.Year}/{it.Date.Month}/{it.Date.Day}/{it.ExchangeTo}”))
)
.ToArray();

var feed = new SyndicationFeed(
“Curs Valutar”,
“CursValutar, case, banci”,
new Uri( “http://www.infovalutar.ro/”),
items
);
feed.Language = “ro-ro”;
feed.TimeToLive = TimeSpan.FromSeconds(30);
using var sw = new StringWriter();
using var rssWriter = XmlWriter.Create(sw);

var rssFormatter = new Rss20FeedFormatter(feed,false);
rssFormatter.WriteTo(rssWriter);
rssWriter.Close();
return Content(sw.ToString(), “text/xml”);
}

 

What about http://infovalutar.ro/curs.asmx?wsdl ? Found https://devblogs.microsoft.com/dotnet/custom-asp-net-core-middleware-example/ article , that says”it has no support for message security, WSDL generation, duplex channels, non-HTTP transports” – so I do not want to do. Maybe something should be left…

So , now , how I can now intercept calls like

www.infovalutar.ro/bnr/2004/10/10/EUR

www.infovalutar.ro/bnr/azi/eur

www.infovalutar.ro/2004/6/4/eur.bnr

http://www.infovalutar.ro/bnr/rss

? There is no controller ! So – middleware to help!

Infovalutar

And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at https://github.com/ignatandrei/InfoValutar/ )
NrPost 
1Start
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
8ECB
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
13WebAPI
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.