public Role GetByEmail(string email) { Guid g = Guid.Parse("dfe32bbd-3e0e-4c79-ab17-5f3104296b7e"); Role model = _identityDatabaseContext.Set <Role>().Where(p => p.Id == g).FirstOrDefault(); return(model); }
public DataSourceResult Get(Kendo.DynamicLinq.View filters) { Kendo.DynamicLinq.Filter Filter = null; if (filters.Filter != null) { Filter = filters.FieldTypeCheckAll(filters.Filter); } if (Filter != null) { filters.Filter = Filter; } //List<Models.Domain.User> result = new List<User>(); DataSourceResult result = _identityDatabaseContext.Set <Models.Domain.User>() .OrderBy(p => p.CreateDate) // EF requires ordering for paging .ToDataSourceResult(filters.Take, filters.Skip, filters.Sort, filters.Filter, filters.Aggregates); return(result); }
public bool IsAddedRole(User user, Guid roleId) { UserRole role = _identityDatabaseContext.Set <UserRole>().Where(p => p.Id == roleId).FirstOrDefault(); if (role != null) { return(true); } return(false); }
public Result <Jwt> CheckToken(Guid token) { Jwt jwt = null; var resultTokens = _identityDatabaseContext.Set <Jwt>().Where(p => p.Token == token).ToList(); if (resultTokens.Count > 0) { jwt = resultTokens[0]; if (jwt.DeadLine < DateTime.Now) { jwt = null; } } if (jwt == null) { return(new Result <Jwt>(jwt, false)); } else { return(new Result <Jwt>(jwt, true)); } }
public RolePermission GetById(Guid id) { RolePermission model = _identityDatabaseContext.Set <RolePermission>().Where(p => p.Id == id).FirstOrDefault(); return(model); }
public List <Permission> GetAll() { return(_identityDatabaseContext.Set <Permission>().OrderBy(p => p.CreateDate).OrderByDescending(p => p.CreateDate).ToList()); }