namespace MyOffice.Data.Repositories.Motion;

using Models.Motions;

public class MotionGlobalRepository : AppRepository<MotionGlobal>, IMotionGlobalRepository
{
	public MotionGlobal? Get(Guid id)
	{
		return _context.GlobalMotions.FirstOrDefault(x => x.Id == id);
	}

	public MotionGlobal? GetByName(string name)
	{
		return _context.GlobalMotions.FirstOrDefault(x => x.Name == name);
	}

	public bool Add(MotionGlobal motionGlobal)
	{
		return AddBase(motionGlobal) > 0;
	}
}