This commit is contained in:
2023-06-23 09:03:00 +03:00
parent d549877567
commit 4bac59f322
27 changed files with 376 additions and 126 deletions
@@ -21,4 +21,23 @@ public class MotionRepository : AppRepository<Motion>, IMotionRepository
.ThenByDescending(x => x.CreatedOn)
.ToList();
}
public Motion? Get(Guid userId, Guid id)
{
return _context
.Motions
.Include(x => x.Item)
.ThenInclude(x => x.ItemGlobal)
.FirstOrDefault(x => x.Account!.AccessRights!.Any(a => a.UserId == userId) && x.Id == id);
}
public bool Update(Motion motion)
{
return UpdateBase(motion) > 0;
}
public bool Remove(Motion motion)
{
return RemoveBase(motion) > 0;
}
}