jesseliberty.com Open in urlscan Pro
50.62.223.73  Public Scan

Submitted URL: http://jesseliberty.com/
Effective URL: https://jesseliberty.com/
Submission: On August 20 via api from US — Scanned from CA

Form analysis 2 forms found in the DOM

GET https://jesseliberty.com/

<form role="search" method="get" id="searchform" class="searchform" action="https://jesseliberty.com/">
  <div>
    <label class="screen-reader-text" for="s">Search for:</label>
    <input type="text" value="" name="s" id="s">
    <input type="submit" id="searchsubmit" value="Search">
  </div>
</form>

<form id="jp-carousel-comment-form">
  <label for="jp-carousel-comment-form-comment-field" class="screen-reader-text">Write a Comment...</label>
  <textarea name="comment" class="jp-carousel-comment-form-field jp-carousel-comment-form-textarea" id="jp-carousel-comment-form-comment-field" placeholder="Write a Comment..."></textarea>
  <div id="jp-carousel-comment-form-submit-and-info-wrapper">
    <div id="jp-carousel-comment-form-commenting-as">
      <fieldset>
        <label for="jp-carousel-comment-form-email-field">Email (Required)</label>
        <input type="text" name="email" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-email-field">
      </fieldset>
      <fieldset>
        <label for="jp-carousel-comment-form-author-field">Name (Required)</label>
        <input type="text" name="author" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-author-field">
      </fieldset>
      <fieldset>
        <label for="jp-carousel-comment-form-url-field">Website</label>
        <input type="text" name="url" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-url-field">
      </fieldset>
    </div>
    <input type="submit" name="submit" class="jp-carousel-comment-form-button" id="jp-carousel-comment-form-button-submit" value="Post Comment">
  </div>
</form>

Text Content

. .


JESSE LIBERTY

How about a cup <T>?
Skip to content
 * Home
 * Bio
 * Find Me
 * Books & Video Courses
 * Yet Another Podcast
 * Help!
 * Privacy Policy

← Older posts



NDEPEND

Posted on June 17, 2024 by Jesse Liberty

A dive into an amazing program for developers: NDepend

Posted in Essentials | Tagged YAP, YapCast | 1 Comment


SCOTT HUNTER – ASPIRE AND MORE

Posted on June 2, 2024 by Jesse Liberty

Scott Hunter (VP Microsoft) joins Yet Another Podcast’s reboot to talk about
Aspire, Azure and much more. Do not miss this episode… Aspire will blow you
away!

Links to follow.


Posted in Essentials | Tagged YAP, YapCast | 1 Comment


API PART 7 – SWAGGER COMMENTS

Posted on February 15, 2024 by Jesse Liberty

In the previous post, I introduced Swagger and showed how to set up your project
for Swagger. In this post I will show how to add Swagger comments to annotate
your program.

In earlier posts we looked at the database of cars and the Get method that
retrieves the entire list. That can be quite a lot of data going over the wire.
What we want instead is to send pages. I’ll show that briefly and then we’ll
annotate that code.

In the CarController we’ll have a Get method that takes three parameters:
showDeleted, pageNumber and pageSize. The first we’ve seen before, it determines
whether the list returned to the caller will include our deleted records. The
second, pageNumber, will designate which page of data we want to return (zero
based). The third parameter, pageSize, will designate how many records to return
per page.

Thus, if we were to write

Get(false,3,4)


we would expect to get back records 17, 18, 19 and 20, because page 0 would have
records 1-4, page 1 would have 5-8, etc.

Continue reading →
Posted in API, C#, Essentials | Tagged Swagger | 1 Comment


.NET APIS PART 6 – SWAGGER

Posted on February 5, 2024 by Jesse Liberty

This is part 6 in a series about building APIs in .NET using C#. The previous
(part 5) entry is here, and the series starts here.

As you know, an API sits between a client and the back end. It is imperative for
the client programmer to know not only what an API does, but what the URL is,
what verbs it supports and what parameters are available.

Fortunately, there is an open standard and free server: Open API and
Swashbuckle. You install these once for each project and then you can just use
them, as we’ll see.

This post will show you how to install them, using Visual Studio. You’ll obtain
the bits you need using NuGet. Start by installing Swashbuckle.AspNetCore.

Go to your project’s properties and choose Application and Console Application.
Then choose Output under Build and scroll down to where you can check “Generate
a file containing API documentation”

Continue reading →
Posted in API, C# | Tagged Mini-Tutorial | 2 Comments


I NEED WINTER TO END

Posted on February 3, 2024 by Jesse Liberty



Posted in Essentials | Leave a comment


API – VIDEO 1

Posted on January 19, 2024 by Jesse Liberty

An experiment in supplementing the API material with video. This will be rough
at first…


Posted in API, Essentials, Video | Tagged API, Video | Leave a comment


.NET MAUI SPECIAL OFFER

Posted on January 10, 2024 by Jesse Liberty



Posted in .NET MAUI | Leave a comment


.NET APIS PART 5 – ALL THE CRUD APIS

Posted on January 8, 2024 by Jesse Liberty

In the previous posting we saw how to create an API to get all the cars in our
database. In this posting we’ll look at the remaining CRUD (Create Review Update
Delete) operations.

As you may remember, we created a controller named CarController. ASP.NET will
strip off the word Controller, leaving us with Car, which we will use to access
the endpoints of our API.

> An endpoint is just a URL that takes us to the operation we want.

We looked at GetAll, let’s take a look at Get. In this case, we have an id for
the car we want, but we want all the details of that car. Simple!

Continue reading →

Posted in Essentials | 2 Comments


MADS TORGERSEN ON C# 12

Posted on October 13, 2023 by Jesse Liberty
Super excited and proud to have Mads (lead designer of C#) back to talk about C#
12 
Posted in Essentials | Tagged YapCast | 1 Comment


.NET APIS PART 4 – CREATING THE APIS

Posted on September 4, 2023 by Jesse Liberty

We are, finally, ready to create our ASP.NET Core application that will host our
traditional and our minimal APIs. (This series begins here.)

The code for this blog post is available here:
git clone https://github.com/JesseLiberty/Cars.git

Please note that WordPress seems to be broken and so the layout will be
imperfect.

To get started, open Visual Studio 2022 and make sure you are fully up to date.
Click on Create A New Project and select ASP.NET Core Web App, making sure that
C# is the selected language

Continue reading →

Posted in API, Essentials | Leave a comment


FILE COMPARISON

Posted on August 28, 2023 by Jesse Liberty

In a previous post I said I was still looking for the right file comparison
tool. I may have found it! I returned to ExamDiff Pro and voilà! the perfect
combination of power and ease of use. I integrated it with Visual Studio and
life is good.

Posted in Essentials, Tools and Utilities | Leave a comment


.NET APIS PART 3 – DAPPER

Posted on August 27, 2023 by Jesse Liberty

In part 2 of this series we created a simple database. In this part we’ll look
at how to perform CRUD operations against that DataBase in anticipation of
creating APIs for these operations.

Dapper is a micro-ORM (Object Relational Mapper) for .NET that simplifies data
access against a database. In this blog post, we’ll focus on a code example that
employs Dapper to manage a Car entity. This example uses a custom
DatabaseConnectionFactory to handle database connections. Let’s dive right in.

Database configuration

You will need a working MS Sql database running to test the code. In the sample
code, you can set your connections details in the appsettings.json file.

Create the database and car table

Create your database and then you can use the following script to initialize the
database

USE [Cars]
GO
/****** Object:  Table [dbo].[car] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[car](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[make] [varchar](50) NULL,
	[model] [varchar](50) NULL,
	[model_year] [int] NULL,
	[price] [decimal](18, 0) NULL,
	[deleted] [int] NULL,
 CONSTRAINT [add_identity] PRIMARY KEY CLUSTERED
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

Required NuGet Packages

We are using the following NuGet packages:

​- Dapper
- Dapper.SqlBuilder

You can install these packages using the NuGet Package Manager Console:

​Install-Package Dapper
Install-Package Dapper.SqlBuilder

Setting Up the Database Connection Factory

Before we get into the CarRepository class, let’s discuss the
DatabaseConnectionFactory class. This class is responsible for creating and
opening database connections. It leverages DbSettings to get the connection
string:

DatabaseConnectionFactory takes an IOptions<DbSettings> dependency, which allows
it to read the database settings from a configuration source (like
appsettings.json). The GetConnection method uses this information to create and
open a SQL Server connection, which it then returns.

The Car Repository

Initialization and Dependency Injection

The CarRepository class takes a DatabaseConnectionFactory as a constructor
argument, indicating dependency injection:

Methods in Car Repository

GetAll Method

This method returns all the car records. Optionally, it can also return records
marked as deleted.

The GetAll method uses Dapper.SqlBuilder to construct the SQL query dynamically.
This allows for more flexibility, as you can conditionally add WHERE clauses,
joins, or other SQL constructs.

Get Method

This method retrieves a single car record based on its ID:

UpsertAsync Method

The UpsertAsync method handles both insert and update operations:

DeleteAsync Method

The DeleteAsync method marks the record as deleted:

Resources

​Dapper GitHub Repository 
Dapper SqlBuilder

Conclusion

Dapper offers a powerful, yet simple way to perform CRUD operations in .NET
applications. The code example in this post demonstrates how to make the most of
Dapper in a practical scenario involving a Car entity. The
DatabaseConnectionFactory class helps to manage database connections
efficiently, ensuring that the rest of the code can focus on business logic
rather than connection management. Whether you need to build SQL queries
dynamically or perform simple operations, Dapper has tools to help you get the
job done efficiently.

--------------------------------------------------------------------------------

Rodrigo Juarez is a full-stack developer who has specialized in Xamarin in
recent years and is now focusing on MAUI.
He is also a book author. With over 25 years of experience, Rodrigo has
contributed to a diverse array of projects, developing applications for web,
desktop, and mobile platforms. Specialized in Microsoft technologies, he has
expertise across various sectors, including management, services, insurance,
pharmacy, and banking. Rodrigo Juarez can be reached at info@rodrigojuarez.com

Posted in API, Essentials | Leave a comment
← Older posts



 * SEARCH
   
   Search for:


 * ARCHIVES
   
   Archives Select Month June 2024  (2) February 2024  (3) January 2024  (3)
   October 2023  (1) September 2023  (1) August 2023  (3) July 2023  (5) June
   2023  (3) May 2023  (2) April 2023  (1) March 2023  (5) February 2023  (1)
   January 2023  (2) December 2022  (3) November 2022  (7) October 2022  (5)
   September 2022  (1) August 2022  (2) July 2022  (8) June 2022  (9) May 2022
    (1) April 2022  (5) March 2022  (1) February 2022  (4) January 2022  (1)
   December 2021  (2) November 2021  (2) October 2021  (3) September 2021  (2)
   August 2021  (3) June 2021  (1) May 2021  (1) April 2021  (5) March 2021  (2)
   January 2021  (1) September 2020  (3) August 2020  (2) July 2020  (1) June
   2020  (1) May 2020  (4) April 2020  (2) March 2020  (2) February 2020  (2)
   January 2020  (1) December 2019  (1) November 2019  (2) October 2019  (4)
   September 2019  (2) August 2019  (1) February 2019  (1) January 2019  (1)
   December 2018  (1) November 2018  (2) October 2018  (2) August 2018  (1) July
   2018  (1) April 2018  (4) February 2018  (2) January 2018  (7) December 2017
    (1) October 2017  (1) September 2017  (3) August 2017  (4) July 2017  (9)
   June 2017  (3) May 2017  (4) April 2017  (1) March 2017  (4) February 2017
    (3) January 2017  (5) November 2016  (1) October 2016  (1) September 2016
    (7) August 2016  (9) July 2016  (7) June 2016  (2) May 2016  (7) April 2016
    (6) March 2016  (2) February 2016  (2) December 2015  (5) November 2015  (7)
   October 2015  (4) September 2015  (7) August 2015  (7) July 2015  (4) June
   2015  (3) May 2015  (5) April 2015  (7) March 2015  (4) February 2015  (1)
   January 2015  (2) December 2014  (8) November 2014  (2) October 2014  (5)
   September 2014  (8) August 2014  (7) July 2014  (14) June 2014  (17) May 2014
    (4) April 2014  (8) March 2014  (5) February 2014  (4) January 2014  (4)
   December 2013  (6) November 2013  (5) October 2013  (11) September 2013  (16)
   August 2013  (5) July 2013  (5) June 2013  (4) May 2013  (5) April 2013  (6)
   March 2013  (5) February 2013  (6) January 2013  (6) December 2012  (13)
   November 2012  (9) October 2012  (6) September 2012  (12) August 2012  (14)
   July 2012  (8) June 2012  (3) May 2012  (3) April 2012  (5) March 2012  (1)
   February 2012  (5) January 2012  (8) December 2011  (4) November 2011  (12)
   October 2011  (8) September 2011  (10) August 2011  (12) July 2011  (20) June
   2011  (18) May 2011  (21) April 2011  (16) March 2011  (19) February 2011
    (26) January 2011  (24) December 2010  (15) November 2010  (19) October 2010
    (19) September 2010  (32) August 2010  (23) July 2010  (12) June 2010  (12)
   May 2010  (9) April 2010  (14) March 2010  (2) February 2010  (5) January
   2010  (7) December 2009  (12) November 2009  (9) October 2009  (7) September
   2009  (7) August 2009  (11) July 2009  (18) June 2009  (3) May 2009  (8)
   April 2009  (14) March 2009  (14) February 2009  (20) January 2009  (17)
   December 2008  (16) November 2008  (14) October 2008  (25) September 2008
    (17) August 2008  (17) July 2008  (27) June 2008  (18) May 2008  (21) April
   2008  (19) March 2008  (30) February 2008  (25) January 2008  (35) December
   2007  (19) November 2007  (10) October 2007  (12) September 2007  (9) August
   2007  (20) July 2007  (4)

 * 


 * FAVORITE BOOKS

Jesse Liberty
Proudly powered by WordPress.

 

Loading Comments...

 

Write a Comment...
Email (Required) Name (Required) Website