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"
#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.
|
Version | Downloads | Last Updated |
---|---|---|
2.0.1 | 249 | 3/11/2025 |
1.1.1 | 168 | 9/12/2024 |
1.1.0 | 40,953 | 11/10/2021 |
1.0.4.1 | 6,831 | 8/9/2021 |
1.0.4 | 620 | 8/6/2021 |
1.0.3.9 | 854 | 7/19/2021 |
1.0.3.8 | 360 | 7/17/2021 |
1.0.3.7 | 844 | 6/19/2021 |
1.0.3.6 | 288 | 6/11/2021 |
1.0.3.5 | 468 | 5/23/2021 |
1.0.3.4 | 242 | 5/21/2021 |
1.0.3.3 | 236 | 5/20/2021 |
1.0.3.2 | 573 | 5/18/2021 |
1.0.3.1 | 553 | 5/12/2021 |
1.0.3 | 564 | 5/10/2021 |
1.0.2 | 1,475 | 2/21/2021 |
1.0.1 | 549 | 2/21/2021 |
1.0.0 | 972 | 2/13/2021 |
0.0.8.7 | 533 | 2/13/2021 |
0.0.8.6 | 636 | 2/6/2021 |
0.0.8.5 | 647 | 1/29/2021 |
0.0.8.4 | 666 | 1/24/2021 |
0.0.8.3 | 871 | 1/16/2021 |
0.0.8.1 | 748 | 1/3/2021 |
0.0.8 | 538 | 12/27/2020 |
0.0.7.1 | 1,032 | 11/25/2020 |
0.0.7 | 531 | 11/24/2020 |
0.0.6.9 | 3,908 | 10/12/2020 |
0.0.6.8 | 884 | 9/22/2020 |
0.0.6.7 | 787 | 9/8/2020 |
0.0.6.6 | 746 | 8/31/2020 |
0.0.6.5 | 6,402 | 5/17/2020 |
0.0.6.4 | 2,315 | 4/4/2020 |
0.0.6.3 | 714 | 4/1/2020 |
0.0.6.2 | 7,169 | 3/13/2020 |
0.0.6.1 | 898 | 3/4/2020 |
0.0.6 | 918 | 2/26/2020 |
0.0.5.9 | 1,030 | 2/4/2020 |
0.0.5.8 | 1,571 | 12/21/2019 |
0.0.5.7 | 815 | 12/15/2019 |
0.0.5.6 | 916 | 12/1/2019 |
0.0.5.5 | 869 | 11/24/2019 |
0.0.5.4 | 812 | 11/17/2019 |
0.0.5.3 | 838 | 11/13/2019 |
0.0.5.2 | 788 | 11/3/2019 |
0.0.5.1 | 760 | 11/2/2019 |
0.0.5 | 864 | 10/20/2019 |
0.0.4.9 | 913 | 10/14/2019 |
0.0.4.8 | 830 | 10/11/2019 |
0.0.4.7 | 822 | 10/6/2019 |
0.0.4.6 | 1,354 | 9/20/2019 |
0.0.4.5 | 1,901 | 8/3/2019 |
0.0.4.4 | 822 | 8/1/2019 |
0.0.4.3 | 959 | 5/28/2019 |
0.0.4.2 | 1,083 | 5/11/2019 |
0.0.4.1 | 1,301 | 4/11/2019 |
0.0.4 | 1,316 | 4/4/2019 |
0.0.3 | 1,142 | 3/20/2019 |
0.0.2 | 1,283 | 2/7/2019 |
0.0.1 | 1,046 | 9/9/2018 |