public City GetCityById(Guid cityId) { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { return(context.Find <City>(cityId)); } } catch { throw; } }
public Property GetPropertyById(Guid propertyId) { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { return(context.Find <Property>(propertyId)); } } catch { throw; } }
public User GetUserById(Guid userId) { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { return(context.Find <User>(userId)); } } catch { throw; } }
public Role GetRoleById(Guid roleId) { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { return(context.Find <Role>(roleId)); } } catch { throw; } }
public District GetDistrictById(Guid districtId) { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { return(context.Find <District>(districtId)); } } catch { throw; } }
public bool CheckRoleIsUsed(Guid roleId) { try { using (IDbContextBase context = DbContextFactory.GetDbContext()) { int count = context.Find <Role>(roleId).User_Role.Count(); return(count > 0); } } catch { throw; } }