refactoring
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user