update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user