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:

String interpolation for EFCore and Like

I have had a problem with EF Core and String Interpolation – until I realized that was a problem with sp_executesql

But let’s see the whole problem. ta

EFCore supports string interpolation –  that means , if you give this code

<context>.<table>.FromSql($”select blabla from table where id={id}”)

it will transform into

exec sp_executesql N’select blabla from table where id= @p0 ”
‘,N’@p0 int’,@p0=N’200′

And it is very good , because it avoids sql injection . ( Just a note, do not put

$”select blabla from table where id={id}”

into a variable  – you WILL have SqlInjection )

Ok. Now I want to do a like –  plain simple, right ?

<context>.<table>.FromSql($”select blabla from table where CountryName like ‘%{name}%’ ”)

And I try  –  and NO RESULT comes. I will into the generated Sql ( by using SqlProfiler from SSMS ) and it gives

exec sp_executesql N’select blabla from table where CountryName like ”%p0%”’,N’@p0 nvarchar(4000)’,@p0=N’france’

Pretty harmless , right ?

And seems ok – until I have executed directly and see that no results come.

So StackOverflow to the rescue : https://stackoverflow.com/questions/3556506/using-like-in-sp-executesql

And so my query in C# have been modified to

<context>.<table>.FromSql($”select blabla from table where where CountryName like ‘%’ + {name} + ‘%'” )

And now it works!

Moral of the  story : always investigate the sql generated .

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.