GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - IntelliTect/Multitool: Library of useful additions to your C# application

BranchesTags
Open more actions menu

Latest commit

 

History

241 Commits
241 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
IntelliTect.Multitool.AotTest
IntelliTect.Multitool.AotTest
 
 
IntelliTect.Multitool.Tests
IntelliTect.Multitool.Tests
 
 
IntelliTect.Multitool
IntelliTect.Multitool
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Directory.Build.props
Directory.Build.props
 
 
Directory.Packages.props
Directory.Packages.props
 
 
IntelliTect.Multitool.lutconfig
IntelliTect.Multitool.lutconfig
 
 
IntelliTect.Multitool.slnx
IntelliTect.Multitool.slnx
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
global.json
global.json
 
 

Repository files navigation

IntelliTect.Multitool: NuGet

Install Instructions

  1. Add package to project from nuget.org. More instructions to get started with consuming nuget packages can be found on learn.microsoft.com
  2. All tools are under the IntelliTect.Multitool namespace.
  3. That's it! Please open an issue if you have any problems with any of these steps or have other questions.

ReleaseDateAttribute - Gets an UTC DateTime of compile time. Allows us to determine the build date/time

Blog Post/Additional Information: How To Display the Build Date of a .NET Application

Samples:

  • Assignment of GetReleaseDate() to a local variable

    DateTime? date = IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate(); // Returns a datetime in UTC to date
  • Displaying GetReleaseDate() on a cshtml page

    // This example is in cshtml.
    @IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate() // Returns a datetime in UTC
  • Converting and displaying GetReleaseDate() on a cshtml page

    // convert this UTC DateTime object into one for my local timezone that is formatted in a “d MMM, yyyy h:mm:ss tt” (ex: 8 Feb, 2023 11:36:31 AM).
    // The following code will format the date and convert it to my local time zone of Pacific Standard Time. 
    Build: @if (IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate() is DateTime date)
    {
      @TimeZoneInfo.ConvertTimeFromUtc(date, TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")).ToString("d MMM, yyyy h:mm:ss tt", CultureInfo.InvariantCulture)
    }
    // Result is "Build: 8 Feb, 2023 11:36:31 AM"

Miscellaneous Information:

  • To help hot reload in visual studio work properly, the release date attribute will be automatically be generated during compilation on a CI runner, but it won’t generate locally by default. If you want it to generate locally, set the ReleaseDateAttribute to true within a property group in your project file. (<ReleaseDateAttribute>true</ReleaseDateAttribute>)

RepositoryPaths - Provides consistent environment-independent normalized pathing within a git repository

Samples:

  • Get file path from the root of a repository

    // In this case, the GetDefaultRepoRoot() method can be used to get the root of a repository.
    string fullPathToTheFile = Path.Combine(IntelliTect.Multitool.RepositoryPaths.GetDefaultRepoRoot(), "TheFile.txt");

Extensions

  • StringExtensions: Extension methods for System.String
    • ValidateUrlString: Extension method to validate a URL string by checking to make sure the string is formatted correctly.
    • CreateUrlSlug: Extension method modify a string so that it is URL compatible
  • SystemLinqExtensions
    • WhereNotNull: Extension method to allow return of non-null value from a null object.
      • Sample:

        List<string?> listWithSomeNullValues = ["this", null, "is", null, "my", null, "favorite", null];
        List<string> listWithoutNullValues = listWithSomeNullValues.WhereNotNull().ToList();
        // returns ["this", "is", "my", "favorite"]
      • On:

        • System.Linq.Generic.IEnumerable<T>

Contributing

See the CONTRIBUTING.md file here.

If you have any problems, please feel free to check for existing issues or open a new issue.

About

Library of useful additions to your C# application

www.nuget.org/packages/IntelliTect.Multitool

Topics

hacktoberfestintellitectlibrarynuget

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

2 stars

Watchers

9 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.