All Projects → Dotnet-Boxed → Framework

Dotnet-Boxed / Framework

Licence: mit
.NET Core Extensions and Helper NuGet packages.

Projects that are alternatives of or similar to Framework

Templates
.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.
Stars: ✭ 2,864 (+617.79%)
Mutual labels:  graphql, swagger, asp-net-core, asp-net, nuget, dotnet-core
Hotchocolate
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
Stars: ✭ 3,009 (+654.14%)
Mutual labels:  graphql, graphql-server, asp-net-core, asp-net, dotnet-core
Cofoundry
Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development
Stars: ✭ 621 (+55.64%)
Mutual labels:  framework, asp-net-core, asp-net, dotnet-core
Turbulette
😴 Turbulette - A batteries-included framework to build high performance, fully async GraphQL APIs
Stars: ✭ 29 (-92.73%)
Mutual labels:  graphql, graphql-server, framework
Starwars
GraphQL 'Star Wars' example using GraphQL for .NET, ASP.NET Core, Entity Framework Core
Stars: ✭ 559 (+40.1%)
Mutual labels:  graphql, asp-net-core, dotnet-core
Eliasdb
EliasDB a graph-based database.
Stars: ✭ 611 (+53.13%)
Mutual labels:  graphql, swagger, graphql-server
Eschool
eSchool Microservice based Solution
Stars: ✭ 29 (-92.73%)
Mutual labels:  graphql, graphql-server, dotnet-core
Orionjs
A new framework for serverside GraphQL apps
Stars: ✭ 35 (-91.23%)
Mutual labels:  graphql, graphql-server, framework
Server
Framework NodeJS for GraphQl
Stars: ✭ 118 (-70.43%)
Mutual labels:  graphql, graphql-server, framework
PersianDataAnnotations
PersianDataAnnotations is ASP.NET Core MVC & ASP.NET MVC Custom Localization DataAnnotations (Localized MVC Errors) for Persian(Farsi) language - فارسی سازی خطاهای اعتبارسنجی توکار ام.وی.سی. و کور.ام.وی.سی. برای نمایش اعتبار سنجی سمت کلاینت
Stars: ✭ 38 (-90.48%)
Mutual labels:  nuget, asp-net-core, asp-net
X.Web.Sitemap
Simple sitemap generator for .NET
Stars: ✭ 66 (-83.46%)
Mutual labels:  nuget, asp-net-core, asp-net
Raml Dotnet Tools
Visual Studio extension to work with RAML and OAS (OpenAPI) specifications. You can consume REST APIs, scaffold ASP.NET implementations and extract RAML specifications from existing ASP.Net apps.
Stars: ✭ 171 (-57.14%)
Mutual labels:  swagger, asp-net, dotnet-core
Unitynuget
Provides a service to install NuGet packages into a Unity project via the Unity Package Manager
Stars: ✭ 257 (-35.59%)
Mutual labels:  asp-net-core, nuget, dotnet-core
Api Platform
Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Stars: ✭ 7,144 (+1690.48%)
Mutual labels:  graphql, graphql-server, framework
Recaptcha.aspnetcore
Google reCAPTCHA v2/v3 for .NET Core 3.x
Stars: ✭ 122 (-69.42%)
Mutual labels:  asp-net-core, nuget, dotnet-core
Carter
Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable.
Stars: ✭ 875 (+119.3%)
Mutual labels:  asp-net-core, asp-net, dotnet-core
Ocelot
.NET core API Gateway
Stars: ✭ 6,675 (+1572.93%)
Mutual labels:  asp-net-core, asp-net, dotnet-core
Awesome Microservices Netcore
💎 A collection of awesome training series, articles, videos, books, courses, sample projects, and tools for Microservices in .NET Core
Stars: ✭ 865 (+116.79%)
Mutual labels:  asp-net-core, asp-net, dotnet-core
Grial
A Node.js framework for creating GraphQL API servers easily and without a lot of boilerplate.
Stars: ✭ 194 (-51.38%)
Mutual labels:  graphql, graphql-server, framework
UrlBase64
A standards-compliant implementation of web/url-safe base64 encoding and decoding for .NET targets
Stars: ✭ 25 (-93.73%)
Mutual labels:  nuget, asp-net-core, asp-net

.NET Boxed Banner

Twitter URL Twitter Follow

.NET Core Extensions and Helper NuGet packages. If you are looking for the .NET Boxed project templates, you can find them here.

Boxed.Mapping

Boxed.Mapping Boxed.Mapping package in dotnet-boxed feed in Azure Artifacts

A simple and fast (fastest?) object to object mapper that does not use reflection. Read A Simple and Fast Object Mapper for more information.

public class MapFrom
{
    public bool BooleanFrom { get; set; }
    public int IntegerFrom { get; set; }
    public List<MapFromChild> ChildrenFrom { get; set; }
}
public class MapFromChild
{
    public DateTimeOffset DateTimeOffsetFrom { get; set; }
    public string StringFrom { get; set; }
}
 
public class MapTo
{
    public bool BooleanTo { get; set; }
    public int IntegerTo { get; set; }
    public List<MapToChild> ChildrenTo { get; set; }
}
public class MapToChild
{
    public DateTimeOffset DateTimeOffsetTo { get; set; }
    public string StringTo { get; set; }
}

public class DemoMapper : IMapper<MapFrom, MapTo>
{
    private readonly IMapper<MapFromChild, MapToChild> childMapper;
    
    public DemoMapper(IMapper<MapFromChild, MapToChild> childMapper) => this.childMapper = childMapper;
    
    public void Map(MapFrom source, MapTo destination)
    {
        destination.BooleanTo = source.BooleanFrom;
        destination.IntegerTo = source.IntegerFrom;
        destination.ChildrenTo = childMapper.MapList(source.ChildrenFrom);
    }
}

public class DemoChildMapper : IMapper<MapFromChild, MapToChild>
{
    public void Map(MapFromChild source, MapToChild destination)
    {
        destination.DateTimeOffsetTo = source.DateTimeOffsetFrom;
        destination.StringTo = source.StringFrom;
    }
}

public class UsageExample
{
    private readonly IMapper<MapFrom, MapTo> mapper = new DemoMapper();
    
    public MapTo MapOneObject(MapFrom source) => this.mapper.Map(source);
    
    public MapTo[] MapArray(List<MapFrom> source) => this.mapper.MapArray(source);
    
    public List<MapTo> MapList(List<MapFrom> source) => this.mapper.MapList(source);
    
    public IAsyncEnumerable<MapTo> MapAsyncEnumerable(IAsyncEnumerable<MapFrom> source) =>
        this.mapper.MapEnumerableAsync(source);
}

Also includes IImmutableMapper<TSource, TDestination> which is for mapping to immutable types like C# 9 record's and can also be used for enum types.

public record MapFrom(bool BooleanFrom, int IntegerFrom);
public record MapTo(bool BooleanTo, int IntegerTo);

public class DemoImmutableMapper : IImmutableMapper<MapFrom, MapTo>
{
    public MapTo Map(MapFrom source) => 
        new MapTo(source.BooleanFrom, source.IntegerFrom);
}

Boxed.AspNetCore

Boxed.AspNetCore Boxed.AspNetCore package in dotnet-boxed feed in Azure Artifacts

Provides ASP.NET Core middleware, MVC filters, extension methods and helper code for an ASP.NET Core project.

Fluent Interface Extensions

ILoggerFactory Extensions

loggerfactory
    .AddIfElse(
        hostingEnvironment.IsDevelopment(),
        x => x.AddConsole(...).AddDebug(),
        x => x.AddSerilog(...));

IConfiguration Extensions

this.configuration = new ConfigurationBuilder()
    .SetBasePath(hostingEnvironment.ContentRootPath)
    .AddJsonFile("config.json")
    .AddJsonFile($"config.{hostingEnvironment.EnvironmentName}.json", optional: true)
    .AddIf(
        hostingEnvironment.IsDevelopment(),
        x => x.AddUserSecrets())
    .AddEnvironmentVariables()
    .AddApplicationInsightsSettings(developerMode: !hostingEnvironment.IsProduction())
    .Build();

IApplicationBuilder Extensions

application
    .UseIfElse(
        environment.IsDevelopment(),
        x => x.UseDeveloperExceptionPage(),
        x => x.UseStatusCodePagesWithReExecute("/error/{0}/"))
    .UseIf(
        environment.IsStaging(),
        x => x.UseStagingSpecificMiddleware())
    .UseStaticFiles()
    .UseMvc();

SEO Friendly URL's

[HttpGet("product/{id}/{title}", Name = "GetProduct")]
public IActionResult GetProduct(int id, string title)
{
    var product = this.productRepository.Find(id);
    if (product == null)
    {
        return this.NotFound();
    }

    // Get the actual friendly version of the title.
    string friendlyTitle = FriendlyUrlHelper.GetFriendlyTitle(product.Title);

    // Compare the title with the friendly title.
    if (!string.Equals(friendlyTitle, title, StringComparison.Ordinal))
    {
        // If the title is null, empty or does not match the friendly title, return a 301 Permanent
        // Redirect to the correct friendly URL.
        return this.RedirectToRoutePermanent("GetProduct", new { id = id, title = friendlyTitle });
    }

    // The URL the client has browsed to is correct, show them the view containing the product.
    return this.View(product);
}

Canonical URL's

Boxed.AspNetCore.Swagger

Boxed.AspNetCore.Swagger Boxed.AspNetCore.Swagger package in dotnet-boxed feed in Azure Artifacts

Provides ASP.NET Core middleware, MVC filters, extension methods and helper code for an ASP.NET Core project implementing Swagger (OpenAPI).

Boxed.AspNetCore.TagHelpers

Boxed.AspNetCore.TagHelpers Boxed.AspNetCore.TagHelpers package in dotnet-boxed feed in Azure Artifacts

ASP.NET Core tag helpers for Subresource Integrity (SRI), Referrer meta tags, OpenGraph (Facebook) and Twitter social network meta tags. Read more at:

Subresource Integrity (SRI)

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js" 
        asp-subresource-integrity-src="~/js/jquery.min.js"></script>

Social Network Meta Tags

Twitter Cards

<twitter-card-summary-large-image username="@@RehanSaeedUK">

Open Graph (Facebook)

<open-graph-website site-name="My Website"
                    title="Page Title"
                    main-image="@(new OpenGraphImage(
                        Url.AbsoluteContent("~/img/1200x630.png"),
                        ContentType.Png,
                        1200,
                        630))"
                    determiner="OpenGraphDeterminer.Blank">

Boxed.DotnetNewTest

Boxed.DotnetNewTest Boxed.DotnetNewTest package in dotnet-boxed feed in Azure Artifacts

A unit test framework for project templates built using dotnet new.

  1. Install dotnet new based project templates from a directory.
  2. Run dotnet restore, dotnet build and dotnet publish commands.
  3. For ASP.NET Core project templates you can run dotnet run which gives you a HttpClient that you can use to call the app and run further tests.
public class ApiTemplateTest
{
    public ApiTemplateTest() => DotnetNew.Install<ApiTemplateTest>("ApiTemplate.sln").Wait();

    [Theory]
    [InlineData("StatusEndpointOn", "status-endpoint=true")]
    [InlineData("StatusEndpointOff", "status-endpoint=false")]
    public async Task RestoreAndBuild_CustomArguments_IsSuccessful(string name, params string[] arguments)
    {
        using (var tempDirectory = TempDirectory.NewTempDirectory())
        {
            var dictionary = arguments
                .Select(x => x.Split('=', StringSplitOptions.RemoveEmptyEntries))
                .ToDictionary(x => x.First(), x => x.Last());
            var project = await tempDirectory.DotnetNew("api", name, dictionary);
            await project.DotnetRestore();
            await project.DotnetBuild();
        }
    }

    [Fact]
    public async Task Run_DefaultArguments_IsSuccessful()
    {
        using (var tempDirectory = TempDirectory.NewTempDirectory())
        {
            var project = await tempDirectory.DotnetNew("api", "DefaultArguments");
            await project.DotnetRestore();
            await project.DotnetBuild();
            await project.DotnetRun(
                @"Source\DefaultArguments",
                async (httpClient, httpsClient) =>
                {
                    var httpResponse = await httpsClient.GetAsync("status");
                    Assert.Equal(HttpStatusCode.OK, httpResponse.StatusCode);
                });
        }
    }
}

Continuous Integration

Name Operating System Status History
Azure Pipelines Ubuntu Azure Pipelines Ubuntu Build Status
Azure Pipelines Mac Azure Pipelines Mac Build Status
Azure Pipelines Windows Azure Pipelines Windows Build Status
Azure Pipelines Overall Azure Pipelines Overall Build Status Azure DevOps Build History
GitHub Actions Ubuntu, Mac & Windows GitHub Actions Status GitHub Actions Build History
AppVeyor Ubuntu, Mac & Windows AppVeyor Build Status AppVeyor Build History

Contributions and Thanks

Please view the contributing guide for more information.

  • VictorioBerra - Helping to create the Boxed.DotnetNewTest NuGet package.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].