Mix.Heart
1.0.0
See the version list below for details.
dotnet add package Mix.Heart --version 1.0.0
NuGet\Install-Package Mix.Heart -Version 1.0.0
<PackageReference Include="Mix.Heart" Version="1.0.0" />
<PackageVersion Include="Mix.Heart" Version="1.0.0" />
<PackageReference Include="Mix.Heart" />
paket add Mix.Heart --version 1.0.0
#r "nuget: Mix.Heart, 1.0.0"
#:package Mix.Heart@1.0.0
#addin nuget:?package=Mix.Heart&version=1.0.0
#tool nuget:?package=Mix.Heart&version=1.0.0
Mix Heart
[](https://app.fossa.io/projects/git%2Bgithub.com%2FMix IO%2FMix IO-Heart?ref=badge_shield)
[](https://travis-ci.org/Mix IO/Mix IO-Heart)
License
[](https://app.fossa.io/projects/git%2Bgithub.com%2FMix IO%2FMix IO-Heart?ref=badge_large)
Reference
https://github.com/Mix IO/Mix IO-Heart-Sample
Sample Code
Create Models
using System;
namespace SimpleBlog.Data.Blog
{
public class Post
{
public string Id { get; set; }
public string Title { get; set; }
public string SeoName { get; set; }
public string Excerpt { get; set; }
public string Content { get; set; }
public string Author { get; set; }
public DateTime CreatedDateUTC { get; set; }
}
}
public class BlogContext : DbContext
{
public DbSet<Post> Post { get; set; }
public BlogContext()
{ }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlite("Data Source=blogging.db");
//optionsBuilder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=demo-heart.db;Trusted_Connection=True;MultipleActiveResultSets=true");
}
}
}
Using Heart
Create ViewModel Class
namespace SimpleBlog.ViewModels
{
// Create ViewModel using Heart
public class PostViewModel: ViewModelBase<BlogContext, Post, PostViewModel>
{
//Declare properties that this viewmodel need
public string Id { get; set; }
[Required(ErrorMessage = "Title is required")]
public string Title { get; set; }
public DateTime CreatedDateUTC { get; set; }
//Declare properties need for view or convert from model to view
public DateTime CreatedDateLocal { get { return CreatedDateUTC.ToLocalTime(); } }
public PostViewModel()
{
}
public PostViewModel(Post model, BlogContext _context = null, IDbContextTransaction _transaction = null) : base(model, _context, _transaction)
{
}
}
Using
Save
var saveResult = await post.SaveModelAsync();
Get Single
var getPosts = await PostViewModel.Repository.GetSingleModelAsync(p=>p.Id==1);
return View(getPosts.Data);
Get All
var getPosts = await PostViewModel.Repository.GetModelListAsync();
return View(getPosts.Data);
Get All with predicate
var getPosts = await PostViewModel.Repository.GetModelListByAsync(p=>p.Title.Contains("some text"));
return View(getPosts.Data);
Get Paging
var getPosts = await PostViewModel.Repository.GetModelListAsync("CreatedDate", OrderByDirection.Descending, pageSize, pageIndex);
return View(getPosts.Data);
Get Paging with predicate
var getPosts = await PostViewModel.Repository.GetModelListByAsync(p=>p.Title.Contains("some text"), "CreatedDate", OrderByDirection.Descending, pageSize, pageIndex);
return View(getPosts.Data);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- AutoMapper (>= 10.1.1)
- EPPlus (>= 5.5.0)
- Microsoft.AspNetCore.Http.Features (>= 5.0.1)
- Microsoft.EntityFrameworkCore (>= 5.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 5.0.1)
- Microsoft.Extensions.DependencyInjection (>= 5.0.1)
- Newtonsoft.Json (>= 12.0.3)
- System.Net.Http (>= 4.3.4)
- System.Net.Requests (>= 4.3.0)
- System.Runtime.Loader (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Mix.Heart:
| Repository | Stars |
|---|---|
|
mixcore/mix.core
🚀 A future-proof enterprise web CMS supporting both headless and decoupled approaches. Build any type of app with customizable APIs on ASP.NET Core/.NET Core. Completely open-source and designed for flexibility. Since 2018.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.3 | 104 | 3/5/2026 |
| 2.0.2 | 223 | 2/15/2026 |
| 2.0.1 | 706 | 3/11/2025 |
| 1.1.1 | 217 | 9/12/2024 |
| 1.1.0 | 47,229 | 11/10/2021 |
| 1.0.4.1 | 7,358 | 8/9/2021 |
| 1.0.4 | 755 | 8/6/2021 |
| 1.0.3.9 | 980 | 7/19/2021 |
| 1.0.3.8 | 442 | 7/17/2021 |
| 1.0.3.7 | 920 | 6/19/2021 |
| 1.0.3.6 | 365 | 6/11/2021 |
| 1.0.3.5 | 548 | 5/23/2021 |
| 1.0.3.4 | 323 | 5/21/2021 |
| 1.0.3.3 | 317 | 5/20/2021 |
| 1.0.3.2 | 689 | 5/18/2021 |
| 1.0.3.1 | 654 | 5/12/2021 |
| 1.0.3 | 680 | 5/10/2021 |
| 1.0.2 | 1,631 | 2/21/2021 |
| 1.0.1 | 658 | 2/21/2021 |
| 1.0.0 | 1,089 | 2/13/2021 |