Applied 1.2.1.6

Install-Package Applied -Version 1.2.1.6
dotnet add package Applied --version 1.2.1.6
<PackageReference Include="Applied" Version="1.2.1.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Applied --version 1.2.1.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Applied, 1.2.1.6"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Applied as a Cake Addin
#addin nuget:?package=Applied&version=1.2.1.6

// Install Applied as a Cake Tool
#tool nuget:?package=Applied&version=1.2.1.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
    public enum UserEnum
    {
        None,
        User
    }
    [Serializable]
    public class User
    {
        public int UserID { get; set; }
        public string Name { get; set; }
        public DateTime? Time { get; set; }
        public UserEnum Enum { get; set; }
    }
    [Serializable]
    public class UserViewModel
    {
        public int UserID { get; set; }
        public string Name { get; set; }
        public DateTime? Time { get; set; }
        public UserEnum Enum { get; set; }
    }
    User[] users = new User[]
    {
        new User() { UserID = 1, Name = "Sam     " },
        new User() { UserID = 2, Name = "John    " }
    };

    users.Apply(a => new { Time = DateTime.Now, Enum = UserEnum.User });
    users.Trim();
    users.Apply(a => new { Time = DateTime.Now, Enum = UserEnum.User }).Trim();
    UserViewModel[] vm1 = users.ToDataEnumerable<User, UserViewModel>().ToArray();
    DataTable dt1 = users.ToDataTable();
    Dictionary<string, object>[] ds1 = users.ToDictionaries().ToArray();

    UserViewModel[] vm2 = dt1.ToDataEnumerable<UserViewModel>().ToArray();
    UserViewModel[] vm3 = ds1.ToDataEnumerable<UserViewModel>().ToArray();

    DataTable dt2 = vm1.ToDataTable();
    DataTable dt3 = ds1.ToDataTable();

    Dictionary<string, object>[] ds2 = vm1.ToDictionaries().ToArray();
    Dictionary<string, object>[] ds3 = dt1.ToDictionaries().ToArray();
    public class TestData
    {
        public int Year { get; set; }
        public string Name { get; set; }
        public decimal Value { get; set; }
        public decimal Sum { get; set; }
        public decimal Average { get; set; }
        public int RowNumber { get; set; }
        public int Ntile { get; set; }
        public int DenseRank { get; set; }
        public int Rank { get; set; }
        public decimal FirstValue { get; set; }
        public decimal LastValue { get; set; }
        public decimal NthValue { get; set; }
        public decimal Lead { get; set; }
        public decimal Lag { get; set; }
        public decimal CumeDist { get; set; }
        public decimal PercentRank { get; set; }
        public decimal PercentileDisc { get; set; }
        public decimal PercentileCont { get; set; }
        public decimal KeepDenseRankFirst { get; set; }
        public decimal KeepDenseRankLast { get; set; }
    }
    List data = new List();
    data.Add(new TestData() { Year = 2019, Name = "A", Value = 111.1m });
    data.Add(new TestData() { Year = 2019, Name = "B", Value = 333.3m });
    data.Add(new TestData() { Year = 2019, Name = "C", Value = 333.3m });
    data.Add(new TestData() { Year = 2019, Name = "A", Value = 222.2m });
    data.Add(new TestData() { Year = 2019, Name = "C", Value = 444.4m });
    data.Add(new TestData() { Year = 2019, Name = "A", Value = 222.2m });
    data.Add(new TestData() { Year = 2019, Name = "B", Value = 333.3m });
    data.Add(new TestData() { Year = 2019, Name = "C", Value = 555.5m });
    data.Add(new TestData() { Year = 2020, Name = "A", Value = 111.1m });
    data.Add(new TestData() { Year = 2020, Name = "B", Value = 333.3m });
    data.Add(new TestData() { Year = 2020, Name = "A", Value = 222.2m });
    data.Add(new TestData() { Year = 2020, Name = "C", Value = 333.3m });

    data = data.GroupBy(a => new { a.Year }).AsPartition(p => p.OrderBy(a => a.Value).ThenBy(a => a.Name))
    .Over(p => p.Sum(a => a.Value), (a, value) => a.Apply(() => new { Sum = value }))
    .Over(p => p.Average(a => a.Value), (a, value) => a.Apply(() => new { Average = value }))
    .Over(p => p.RowNumber(), (a, value) => a.Apply(() => new { RowNumber = value }))
    .Over(p => p.Ntile(2), (a, value) => a.Apply(() => new { Ntile = value }))
    .Over(p => p.DenseRank(), (a, value) => a.Apply(() => new { DenseRank = value }))
    .Over(p => p.Rank(), (a, value) => a.Apply(() => new { Rank = value }))
    .Over(p => p.FirstValue(a => a.Value), (a, value) => a.Apply(() => new { FirstValue = value }))
    .Over(p => p.LastValue(a => a.Value), (a, value) => a.Apply(() => new { LastValue = value }))
    .Over(p => p.NthValue(a => a.Value, 2), (a, value) => a.Apply(() => new { NthValue = value }))
    .Over(p => p.Lead(a => a.Value), (a, value) => a.Apply(() => new { Lead = value }))
    .Over(p => p.Lag(a => a.Value), (a, value) => a.Apply(() => new { Lag = value }))
    .Over(p => p.CumeDist(), (a, value) => a.Apply(() => new { CumeDist = value }))
    .Over(p => p.PercentRank(), (a, value) => a.Apply(() => new { PercentRank = value }))
    .Over(p => p.PercentileDisc(0.5m, a => a.Value), (a, value) => a.Apply(() => new { PercentileDisc = value }))
    .Over(p => p.PercentileCont(0.5m, a => a.Value), (a, value) => a.Apply(() => new { PercentileCont = value }))
    .Over(p => p.KeepDenseRankFirst(g => g.Sum(a => a.Value)), (a, value) => a.Apply(() => new { KeepDenseRankFirst = value }))
    .Over(p => p.KeepDenseRankLast(g => g.Sum(a => a.Value)), (a, value) => a.Apply(() => new { KeepDenseRankLast = value }))
    .ToList();

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Applied:

Package Downloads
Blazor.WebForm.Components

ASP.NET Web Forms System.Web.UI.WebControls Razor Components For Blazor WebAssembly.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1.6 733 9/3/2021
1.2.1.5 1,306 7/25/2021
1.2.1.4 172 4/4/2021
1.2.1.2 277 12/12/2020
1.2.0.6 298 2/14/2020
1.0.1 308 9/20/2019
1.0.0.8 940 4/28/2018
1.0.0.6 853 6/1/2017