Exchange rates–start project – part 1

(This is the result of 1 hour per day auto-challenge as a full cycle developer)

Long time ago I have made a site about exchange currency rates for National Bank of Romania( and l, later, also Central Europeean Bank ) . It was started on ~ 2004  – found image at https://web.archive.org/web/20041215090302/http://www.infovalutar.ro/

Then was passed via MVC1 – and it looks like in https://web.archive.org/web/20180227023708/http://www.infovalutar.ro/bnr

Now it is the moment to pass to .NET Core and Azure.

Here are some requirements:

  1. Must parse at specified times the exchange currencies from multiple banks
  2. Must show the exchange rates
  3. Must have a Web application, a Console one , a Mobile one
  4. Must be easy accessible to programmers – if they want to have the exchange rates ( rss, custom links)
  5. Must have a download link for all values
  6. Must have charts
  7. Must be easy to use – whatever that means

 

I will work at the applications 1 hour per day – and see what it is happening over the 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

Angular Pipe to match and select words in a text

I needed two times the same pipe to match and select words in a text .

I maybe put later in a npm package, but until then , here it is

import { PipeTransform, Pipe } from '@angular/core';

@Pipe({ name: 'highlight' })
export class HighlightPipe implements PipeTransform {
  transform(text: string, search): string {
     // window.alert(text );
     //console.log(search );
    if (search && text) {
      let pattern = search.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
      pattern = pattern.split(' ').filter((t) => {
        return t.length > 0;
      }).join('|');
      const regex = new RegExp(pattern, 'gi');

      return text.replace(regex, (match) => `<b><i><strong>${match}</strong></i></b>`);
    } else {
      return text;
    }
  }
}

 

You can use by performing 3 steps:

  1.  Creating a highPipe.ts and copying the code above
  2. In File : app.module.ts , at @NgModule, ad declarations  add  HighlightPipe ( also,
    import {HighlightPipe} from ‘./highPipe’; )
  3. <span [innerHTML]=”name  | highlight: selectedText”></span>

Things to improve:

1. The regex should be a parameter ( with the default value seen below)

2. How to select the word should be a parameter also ( here is <b><i> )

 

Presentation .NET Core3 Wha’s New

From the presentation:

C# 8.0 What’s new

Reference:

https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8 https://github.com/dotnet/csharplang/blob/master/meetings/2017/LDM-2017-03-08.md

Demos:

  1. Default Interface Inheritance

  2. Multiple Interface Inheritance
  3. Switch
  4. Deconstruct

Other demos:

  1. UsingUsage

  2. StaticLocalFunctions();
  3. Nullable();
  4. Version();
  5. Indexes();
  6. NullCoalescing();

.NET Core What’s new

Reference:

https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0

https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0/

Demos:

  1. AsyncEnumerable

  2. WPF
  3. COM
  4. Build ( trim, single file)
  5. Diamond hell with plugins

See NetCore3WhatsNew.sln and AssemblyLoadingUnloadingDiamond.sln

ASP.NET Core What’s new

Reference:

https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-3.0?view=aspnetcore-3.0

  1. Blazor + Blazor Server

  2. gRPC – https://docs.microsoft.com/en-us/aspnet/core/grpc/index?view=aspnetcore-3.0
  3. SignalR – reconnection, authorization

  4. NewtonSoft => System.Text.JSON
  5. Windows Authentication has been extended onto Linux and macOS.
  6. GenericHost – see https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#hostbuilder-replaces-webhostbuilder
  7. As of ASP.NET Core 3.0, .NET Framework is no longer a supported target framework

EF Core What’s new

Reference: https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-ef-6-3-general-availability/

  1. Refactoring + Single SQL statement per LINQ query

  2. Restricted client evaluation – i.e. Explicit AsEnumerable
  3. C# 8.0 support – AsAsyncEnumerable
  4. IDbCommandInterceptor

See NetCore3WhatsNew.sln , AsyncEnumerable

See https://github.com/ignatandrei/EFRecordAndPlay/tree/master/EF_Core3/EFCoreRecordAndPlay/EFRec

The video whole presentation ( in Romanian) you can find  at https://www.youtube.com/watch?v=GjJGMwkSnao&feature=youtu.be&fbclid=IwAR1i33TSycffNQ8O-iDjf2l_yU9IL1g2ylRPqiG7OkOZo5RRdy0CxklnbTk 

The demo is at https://github.com/ignatandrei/Presentations/tree/master/2019/shorts/NetCore3.0WhatsNew

Learning PowerBI

Just for my memory, this is how I started learning PowerBI:

 
1. Download PowerBI Desktop https://powerbi.microsoft.com/en-us/desktop/

2.    Make sure you have the QuickStart https://docs.microsoft.com/en-us/power-bi/desktop-quickstart-connect-to-data

3.    Read the tutorials /samples from https://docs.microsoft.com/en-us/power-bi/desktop-what-is-desktop

4.    Goto https://appsource.microsoft.com/en-us/marketplace/apps?page=1&src=office&product=power-bi-visuals  and be sure that you see RUN in PowerBI Desktop all visuals created by Microsoft ( each visual has a downloadable DEMO file that can be opened in PBI Desktop)

5.    Goto https://appsource.microsoft.com/en-us/marketplace/apps?page=1&src=office&product=power-bi-visuals and  find some visuals that seems nice ( https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104381112?src=office )

That will be all  – and that means at least 1 week of hard working….

What’s new in .NET Core 3

If you want to see what is new in .NET Core 3, please join tomorrow at https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/events/264063550/ .

We will have talk about

C# 8.0 What’s new

Reference:

https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8

Demos:

  1. Default Interface Inheritance

  2. Multiple Interface Inheritance
  3. Switch
  4. Deconstruct

Other demos:

  1. UsingUsage

  2. StaticLocalFunctions();
  3. Nullable();
  4. Version();
  5. Indexes();
  6. NullCoalescing();

See NetCore3WhatsNew.sln

.NET Core What’s new

Reference:

https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0

https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0/

Demos:

  1. AsyncEnumerable

  2. WPF
  3. COM
  4. Build ( trim, single file)
  5. Diamond hell with plugins

See NetCore3WhatsNew.sln and AssemblyLoadingUnloadingDiamond.sln

ASP.NET Core What’s new

Reference:

https://docs.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-3.0?view=aspnetcore-3.0

  1. Blazor + Blazor Server

  2. gRPC – https://docs.microsoft.com/en-us/aspnet/core/grpc/index?view=aspnetcore-3.0
  3. SignalR – reconnection, authorization

  4. NewtonSoft => System.Text.JSON
  5. Windows Authentication has been extended onto Linux and macOS.
  6. GenericHost – see https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#hostbuilder-replaces-webhostbuilder
  7. As of ASP.NET Core 3.0, .NET Framework is no longer a supported target framework

EF Core What’s new

Reference: https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-ef-6-3-general-availability/

  1. Refactoring + Single SQL statement per LINQ query

  2. Restricted client evaluation – i.e. Explicit AsEnumerable
  3. C# 8.0 support – AsAsyncEnumerable
  4. IDbCommandInterceptor

See NetCore3WhatsNew.sln , AsyncEnumerable

So I wait tomorrow at https://www.meetup.com/Bucharest-A-D-C-E-S-Meetup/events/264063550/ .

.NET Core 3 – what impressed me

This are the things that have impressed me:

  • Async Streams ( think in conjunction with about EFCore / SignalR / gRPC / Observables)
  •  .NET Default Interface members ( not appliable to classes  – so multiple inheritance is a problem just for interfaces…)
  • Deconstruct – see a class from his properties
  • Switch  – they improved Switch to work practically in any case scenario
  • For Windows Application –  COM support, MSIX
  • For any application – Default Files Executable ( about time!), assembly linking( tree-shaking in Javascript idiom) , single files executables ( like a jar file, but executable)
  • For plugins: Assembly loading improvements and Assembly Unloadability
  • gRPC in ASP.NET Core
  • SignalR improvements
  • Windows Authentication has been extended onto Linux and macOS
  • As of ASP.NET Core 3.0, .NET Framework is no longer a supported target framework.
  • EFCore : Restricted client evaluation – Explicit loading data from database
  • EFCore: Async in loading data
  • EFCore : IDBCommandInterceptor for

But there are more improvements( nullable for classes , using syntax, static local functions…)

Be sure that you read the links:

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.