• .Net,  .Net Core,  Microsoft,  Visual Studio 2019

    Dot Net Hell by any other name?

    Just when I think Dot Net Hell days are coming behind us… I run across the reality of the fact that those that created this in the first place are… well… still doing it?

     

    Take this little gem:

    public static async IAsyncEnumerable<string> GetContent(string[] urls)
    {
    
    }

    Yes, we now have IAsyncEnumerable… or do we.   In my little experiment, I have a .Net 4.8 console app with C#8.0 language stuff turned on. So, I wanted to mess about with the Async Enumerable…. But in my console app that IAsyncEnumerble goes all red line of crap on me.

    So what’s the deal?  Well it’s simple once you do the digging.   .Net 4.8 does not implement .Net Standard 2.1… Yeah, you guessed it… where the Async Enumerable lives!

    So yeah, I could use .Net Core 3.0 which works with C# 8.0 and .Net Standard 2.1. Or here’s a thought why not just do a .Net Standard 2.1 console app? Well, the latest version of VS 2019 does not have a .Net Standard 2.1 template listed… Ummm, I’m sensing something missing there.

    Welcome to the “New” Hell! 

    ~ScottGeek….

  • .Net,  Microsoft,  Visual Studio 2019

    Program Challenge using CSV and NetMQ Part 1.

    I did a recent program challenge. The requirements were not too complicated.

    Basically I was given a simple csv formatted file (csv, of course, being a comma delimited text file). The challenge was to take this csv and parse it into a POCO- POCO being Plain Old Class Object. I’m not sure why we need a acronym for that. POCO is just a data structure in the form of a Class Object. But I digress.

    Once the csv is parsed into a Class Object, I was then to make it available in a Request/Response using NetMQ. Now on the surface this might seem a lot to do. But not really. The key, as always, is to break down the problem into the workable bits.

    We start with what we know some tasks:

    A) Input is a csv and it must be read into a Class Object.
    B) Using Request/Response pattern the csv must output using NetMQ (this part relies on getting A done correctly).
    C) The Request and Response should be in two separate applications. Task A will need to expose the Class Object as the Response, this is Application 1. Application 2 will be the Request that will output the Class Object. 

    So let’s look at  the first part of task A.

    Now as much as I like writing yet another file parser- not really- I opted in this case to use one that is already available. It’s call CsvHelper bu Josh Close. It’s available on NuGet of course. The nice thing about this one is it’s simple and it works with POCO’s.  You wire it up based on your class object.

    Let’s start with my POCO (this was given by looking at the csv that just happens to have the first row with column names):

    public class People
    {
        public string Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string Country { get; set; }
    }

    Now wiring this into the csv parser is a simple matter of having a text reader and creating a new csvreader with the helper:

    static List<People> giveMeData(TextReader textReader)
    {
        var csvReader = new CsvReader(textReader);
        var theData = csvReader.GetRecords<People>();
        return (theData.ToList());
    }

    Here I’ve method that parses the csv and makes a list of People.

    And that’s it for the first part of task A. The second part of task A has to do with exposing this List of People through NetMQ. 

    We will do this in next part of this blog.

     

  • .Net,  Build2019,  Microsoft

    Build 2019 Session: .Net Goodness

    Yes, I know I’m a little behind on picking out my favorite Build 2019 Session… So here the first one…

    Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA

    Microsoft Build 2019 Developer Conference May 6-8 Seattle, WA

    .NET Platform Overview and Roadmap

    Join developers and industry experts at Microsoft Build to explore the latest developer tools and technologies. #MSBuild

    Source: .NET Platform Overview and Roadmap

  • .Net,  Microsoft

    From the Dot Net Config some Good Web Sites to check out.

    So in the travels about with the .Net Conf this week check out some site:

     

    Awesome .NET open source & community resources

     And…

    BuiltWithDot.Net is a community showcase of projects built with .net framework, .net core, xamarin, mono, mono game, unity, or godot. Anyone can submit.
     

    And…