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" />
paket add Mix.Heart --version 1.0.0
#r "nuget: Mix.Heart, 1.0.0"
// Install Mix.Heart as a Cake Addin #addin nuget:?package=Mix.Heart&version=1.0.0 // Install Mix.Heart as a Cake Tool #tool nuget:?package=Mix.Heart&version=1.0.0
Mix Heart
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FMix IO%2FMix IO-Heart.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FMix IO%2FMix IO-Heart?ref=badge_shield) [![Build Status](https://travis-ci.org/Mix IO/Mix IO-Heart.svg?branch=master)](https://travis-ci.org/Mix IO/Mix IO-Heart)
License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FMix IO%2FMix IO-Heart.svg?type=large)](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. |
.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
🚀 Mixcore CMS is an Future-Proof Enterprise Web CMS that supports both headless and decoupled to easily build any kinds of app/web app/all in all/customizable APIs built on top of ASP.NET Core / Dotnet Core. It is a completely open-source ASP.NET Core (Dotnet Core) CMS solution. https://mixcore.org
|
Version | Downloads | Last updated |
---|---|---|
1.1.1 | 133 | 9/12/2024 |
1.1.0 | 34,516 | 11/10/2021 |
1.0.4.1 | 6,052 | 8/9/2021 |
1.0.4 | 566 | 8/6/2021 |
1.0.3.9 | 798 | 7/19/2021 |
1.0.3.8 | 304 | 7/17/2021 |
1.0.3.7 | 781 | 6/19/2021 |
1.0.3.6 | 234 | 6/11/2021 |
1.0.3.5 | 413 | 5/23/2021 |
1.0.3.4 | 188 | 5/21/2021 |
1.0.3.3 | 182 | 5/20/2021 |
1.0.3.2 | 516 | 5/18/2021 |
1.0.3.1 | 497 | 5/12/2021 |
1.0.3 | 510 | 5/10/2021 |
1.0.2 | 1,410 | 2/21/2021 |
1.0.1 | 475 | 2/21/2021 |
1.0.0 | 910 | 2/13/2021 |
0.0.8.7 | 465 | 2/13/2021 |
0.0.8.6 | 570 | 2/6/2021 |
0.0.8.5 | 583 | 1/29/2021 |
0.0.8.4 | 602 | 1/24/2021 |
0.0.8.3 | 808 | 1/16/2021 |
0.0.8.1 | 682 | 1/3/2021 |
0.0.8 | 473 | 12/27/2020 |
0.0.7.1 | 950 | 11/25/2020 |
0.0.7 | 466 | 11/24/2020 |
0.0.6.9 | 3,382 | 10/12/2020 |
0.0.6.8 | 818 | 9/22/2020 |
0.0.6.7 | 720 | 9/8/2020 |
0.0.6.6 | 663 | 8/31/2020 |
0.0.6.5 | 5,472 | 5/17/2020 |
0.0.6.4 | 2,243 | 4/4/2020 |
0.0.6.3 | 641 | 4/1/2020 |
0.0.6.2 | 6,238 | 3/13/2020 |
0.0.6.1 | 825 | 3/4/2020 |
0.0.6 | 842 | 2/26/2020 |
0.0.5.9 | 957 | 2/4/2020 |
0.0.5.8 | 1,496 | 12/21/2019 |
0.0.5.7 | 740 | 12/15/2019 |
0.0.5.6 | 843 | 12/1/2019 |
0.0.5.5 | 794 | 11/24/2019 |
0.0.5.4 | 739 | 11/17/2019 |
0.0.5.3 | 766 | 11/13/2019 |
0.0.5.2 | 712 | 11/3/2019 |
0.0.5.1 | 686 | 11/2/2019 |
0.0.5 | 786 | 10/20/2019 |
0.0.4.9 | 831 | 10/14/2019 |
0.0.4.8 | 755 | 10/11/2019 |
0.0.4.7 | 749 | 10/6/2019 |
0.0.4.6 | 1,276 | 9/20/2019 |
0.0.4.5 | 1,817 | 8/3/2019 |
0.0.4.4 | 747 | 8/1/2019 |
0.0.4.3 | 883 | 5/28/2019 |
0.0.4.2 | 1,008 | 5/11/2019 |
0.0.4.1 | 1,218 | 4/11/2019 |
0.0.4 | 1,238 | 4/4/2019 |
0.0.3 | 1,065 | 3/20/2019 |
0.0.2 | 1,201 | 2/7/2019 |
0.0.1 | 946 | 9/9/2018 |