committed by
GitHub
parent
ac20664446
commit
79549bea05
32
MainProject/Utils/CommonDbMethodsUtils.cs
Normal file
32
MainProject/Utils/CommonDbMethodsUtils.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using BasicDotnetTemplate.MainProject.Core.Database;
|
||||
using BasicDotnetTemplate.MainProject.Models.Database.SqlServer;
|
||||
|
||||
namespace BasicDotnetTemplate.MainProject.Utils;
|
||||
public class CommonDbMethodsUtils
|
||||
{
|
||||
private readonly SqlServerContext _sqlServerContext;
|
||||
|
||||
public CommonDbMethodsUtils(SqlServerContext sqlServerContext)
|
||||
{
|
||||
_sqlServerContext = sqlServerContext;
|
||||
}
|
||||
|
||||
|
||||
public IQueryable<Role> GetRolesQueryable()
|
||||
{
|
||||
return this._sqlServerContext.Roles.Where(x => !x.IsDeleted);
|
||||
}
|
||||
|
||||
public IQueryable<Role> GetRoleByNameQueryable(string name)
|
||||
{
|
||||
return this.GetRolesQueryable().Where(x =>
|
||||
x.Name.ToString() == name.ToString()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user