21 lines
470 B
C#
21 lines
470 B
C#
namespace MyOffice.Data.Repositories.Item;
|
|
|
|
using MyOffice.Data.Models.Items;
|
|
|
|
public class ItemGlobalRepository : AppRepository<ItemGlobal>, IItemGlobalRepository
|
|
{
|
|
public ItemGlobal? Get(Guid id)
|
|
{
|
|
return _context.ItemGlobals.FirstOrDefault(x => x.Id == id);
|
|
}
|
|
|
|
public ItemGlobal? GetByName(string name)
|
|
{
|
|
return _context.ItemGlobals.FirstOrDefault(x => x.Name == name);
|
|
}
|
|
|
|
public bool Add(ItemGlobal itemGlobal)
|
|
{
|
|
return AddBase(itemGlobal) > 0;
|
|
}
|
|
} |