Repository navigation
DotTrend 1.0.0 - Initial Release
I am excited to announce the first official release of DotTrend, a .NET library for generating time-series trend data from Entity Framework Core queries with support for multiple database providers.
🎯 Overview
DotTrend makes it easy to create trend reports by date intervals (minute, hour, day, week, month, year) with automatic zero-filling for missing periods. It's built with a fluent API design that integrates seamlessly with Entity Framework Core and supports multiple database providers out of the box.
Inspiration: DotTrend is heavily inspired by the Laravel Trend package, bringing similar time-series trend generation capabilities to the .NET ecosystem.
✨ Key Features
- Flexible Time Intervals: Group data by minute, hour, day, week, month, or year
- Multiple Aggregation Functions: Count, sum, average, min, max
- Cross-database Support:
- SQL Server
- MySQL
- PostgreSQL
- SQLite
- Fluent API Design: Intuitive and chainable methods
- Zero-filling: Automatically handle missing data points
- Multiple Usage Patterns: Traditional, extension methods, or static approaches
- Custom Date Columns: Specify which column to use for date grouping
🔧 Installation
dotnet add package DotTrend📊 Quick Example
// Get daily order counts for January 2025
var dailyOrderCounts = Trend<Order>
.Query(dbContext.Orders)
.Between(new DateTime(2025, 1, 1), new DateTime(2025, 1, 31))
.PerDay()
.Count();
// Display the results
foreach (var point in dailyOrderCounts)
{
Console.WriteLine($"{point.Date:yyyy-MM-dd}: {point.Aggregate}");
}🧠 Design Philosophy
DotTrend was designed to solve the common challenge of generating trend data from databases without the complexities of writing custom SQL for each database provider. It abstracts away the differences between database systems while providing a consistent, type-safe API.
🔜 What's Next
I don't know yet, let's see where this goes :)
📝 Documentation
For full documentation and usage examples, check out the README.
🙏 Feedback & Contributions
I'm open to feedback, bug reports, and pull requests! Please open an issue or submit a PR on GitHub.
Compatible with .NET 8.0 and .NET 9.0 applications.
Full Changelog: https://github.com/shoboske/dot-trend/commits/v1.0.0