Coder Social home page Coder Social logo

coalesce.starter's Introduction

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");

Security

  • ClaimsPrincipalExtensions: Extension methods to get a user ID and roles.
    • GetUserId
    • GetRoles

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
  • HttpExtensions: Extension methods for System.Net.Http.HttpClient ValidateUri: Extension methods to validate a Uri by attempting to make a GET request to it.
  • 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.

coalesce.starter's People

Contributors

adamskt avatar ascott18 avatar granterickson avatar jaspet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

finlaysonc

coalesce.starter's Issues

Add .gitattributes file from IntelliTect/Coalesce

Would be nice to have diffs in Github correctly identify our generated files.

Just copy it on over to this project, making sure to change Coalesce.Web in its contents with Coalesce.Starter so the powershell script will change out the name when it's run.

Coalesce task fails using Task Runner Explorer in VS 2017 stock install

The shell.task command of the 'coalesce' task in the gulpfile.js fails with the error below. It appears that the 0.6.0 version of gulp-shell introduced a change that caused this issue. Setting the version of gulp-shell to 0.5.2 works.
Note the changes in 0.6.0 to the underlying start method.
https://github.com/sun-zheng-an/gulp-shell/releases/tag/0.6.0

[06:40:02] Starting 'coalesce'...
[06:40:02] dotnet coalesce
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn dotnet coalesce ENOENT
at exports._errnoException (util.js:856:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:474:9)
at process._tickCallback (node.js:388:17)
at Function.Module.runMain (module.js:431:11)
at startup (node.js:139:18)
at node.js:999:3
Process terminated with code 1.

Add select2-bootstrap-theme, remove boilerplate select2 styles from site.scss

https://github.com/select2/select2-bootstrap-theme looks quite a bit nicer than what we provide out of the box now - using this in the starter project instead of our couple of lines of css to get some heights to look right will provide a much nicer experience.

  • Add package references to select2-bootstrap-theme
  • Add configuration to use this theme - Coalesce.GlobalConfiguration.app.select2Theme
  • Remove old select2 css from site.scss

This change should also be propagated to the demo project - https://github.com/IntelliTect/Coalesce/tree/2.0/src/Coalesce.Web

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.