refactoring

This commit is contained in:
2023-06-22 10:01:27 +03:00
parent e9d4053e65
commit d549877567
116 changed files with 1216 additions and 11709 deletions
@@ -0,0 +1,24 @@
namespace MyOffice.Data.Repositories.Account;
using Microsoft.EntityFrameworkCore;
using Models.Accounts;
public class MotionRepository : AppRepository<Motion>, IMotionRepository
{
public bool Add(Motion motion)
{
return AddBase(motion) > 0;
}
public List<Motion> GetByAccount(Guid accountId, DateTime dateFrom, DateTime dateTo)
{
return _context
.Motions
.Include(x => x.Item)
.ThenInclude(x => x.ItemGlobal)
.Where(x => x.AccountId == accountId && x.DateTime >= dateFrom && x.DateTime <= dateTo)
.OrderByDescending(x => x.DateTime)
.ThenByDescending(x => x.CreatedOn)
.ToList();
}
}