Nuget: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 31: | Line 31: | ||
dotnet add reference ../Chorke.Academia.Core.Utility | dotnet add reference ../Chorke.Academia.Core.Utility | ||
dotnet sln add Chorke.Academia.Core.Utility.Tests | dotnet sln add Chorke.Academia.Core.Utility.Tests | ||
</source> | |||
<source lang="C#"> | |||
using System; | |||
using System.Globalization; | |||
namespace Chorke.Academia.Core.Utility | |||
{ | |||
class DateUtil | |||
{ | |||
public const string MMMM_DD_YYYY = "dd/MM/yyyy"; | |||
public static String Format(DateTime date) => Format(date, MMMM_DD_YYYY); | |||
public static String Format(DateTime date, string format) => date.ToString(MMMM_DD_YYYY); | |||
public static DateTime Parse(String date) => Parse(date, MMMM_DD_YYYY); | |||
public static DateTime Parse(String date, string format) => DateTime.ParseExact(date, format, CultureInfo.InvariantCulture); | |||
} | |||
} | |||
</source> | </source> | ||
Revision as of 10:04, 12 July 2019
Mono Nuget
brew install mono
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
'alias nuget="mono /usr/local/bin/nuget.exe"' >> ~/.bash_profile
brew uninstall mono
sudo rm -rf /usr/local/bin/nuget.exe
# vim ~/.bash_profile and delete 'alias nuget="mono /usr/local/bin/nuget.exe"'
nuget setapikey 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a
nuget setapikey 4003d786-cc37-4004-bfdf-c4f3e8ef9b3a -source https://cdn.chorke.org/feed
Utility Project
mkdir Utility
cd Utility
dotnet new classlib -n Chorke.Academia.Core.Utility
dotnet new xunit -n Chorke.Academia.Core.Utility.Tests
dotnet new sln -n Utility
dotnet sln add Chorke.Academia.Core.Utility
cd ../Chorke.Academia.Core.Utility.Tests/
dotnet add reference ../Chorke.Academia.Core.Utility
dotnet sln add Chorke.Academia.Core.Utility.Tests
using System;
using System.Globalization;
namespace Chorke.Academia.Core.Utility
{
class DateUtil
{
public const string MMMM_DD_YYYY = "dd/MM/yyyy";
public static String Format(DateTime date) => Format(date, MMMM_DD_YYYY);
public static String Format(DateTime date, string format) => date.ToString(MMMM_DD_YYYY);
public static DateTime Parse(String date) => Parse(date, MMMM_DD_YYYY);
public static DateTime Parse(String date, string format) => DateTime.ParseExact(date, format, CultureInfo.InvariantCulture);
}
}
References
- Configuring NuGet for use with GitHub Package Registry
- Creating and using a local NuGet package repository
- How to publish ASP.NET Core app over FTP server
- Publish a NuGet package from the command line
- How to publish a dotnet global tool
- Create nuget package .net core
- Dotnet nuget sources command
- NuGet CLI setapikey command
- Create and publish a package
- Install NuGet client tools
- NuGet Repositories