public bool EditYorum(Yorum yorum) { using (var databaseContext = new HaberContext()) { databaseContext.Entry(yorum).State = EntityState.Modified; return(databaseContext.SaveChanges() > 0); } }
public bool EditKategori(Kategori kategori) { using (var databaseContext = new HaberContext()) { databaseContext.Entry(kategori).State = EntityState.Modified; return(databaseContext.SaveChanges() > 0); } }
public bool EditHaber(Entities.EF.Haber haber) { using (var databaseContext = new HaberContext()) { databaseContext.Entry(haber).State = EntityState.Modified; return(databaseContext.SaveChanges() > 0); } }
public Entities.EF.Haber GetHaber(int id) { Entities.EF.Haber haber; using (var databaseContext = new HaberContext()) { haber = databaseContext.Haber.FirstOrDefault(i => i.Id.Equals(id)); } return(haber); }
public Kategori GetKategori(int id) { Kategori kategori; using (var databaseContext = new HaberContext()) { kategori = databaseContext.Kategori.FirstOrDefault(i => i.Id.Equals(id)); } return(kategori); }
public Yorum GetYorum(int id) { Yorum yorum; using (var databaseContext = new HaberContext()) { yorum = databaseContext.Yorum.FirstOrDefault(i => i.Id.Equals(id)); } return(yorum); }
public List <Entities.EF.Haber> GetAllHaber() { List <Entities.EF.Haber> haber; using (HaberContext databaseContext = new HaberContext()) { haber = databaseContext.Haber.Include("Kategori").ToList(); } return(haber); }
public Kullanici GetKullanici(int id) { Kullanici kullanici; using (var databaseContext = new HaberContext()) { kullanici = databaseContext.Kullanici.FirstOrDefault(i => i.Id.Equals(id)); } return(kullanici); }
public List <Galeri> GetAllGaleri() { List <Galeri> galeri; using (var database = new HaberContext()) { galeri = database.Galeri.ToList(); } return(galeri); }
public List <Kategori> GetAllKategori() { List <Kategori> kategori; using (var database = new HaberContext()) { kategori = database.Kategori.ToList(); } return(kategori); }
public List <Yorum> GetAllYorum() { List <Yorum> yorum; using (var database = new HaberContext()) { yorum = database.Yorum.ToList(); } return(yorum); }
public Galeri GetGaleri(int id) { Galeri galeri; using (var databaseContext = new HaberContext()) { galeri = databaseContext.Galeri.FirstOrDefault(i => i.Id.Equals(id)); } return(galeri); }
public List <Kullanici> GetAllKullanici() { List <Kullanici> kullanici; using ( var database = new HaberContext()) { kullanici = database.Kullanici.ToList(); } return(kullanici); }
public YazarHelper(HaberContext tContext) { context = tContext; }
public static int kullaniciSayisi() { HaberContext context = new HaberContext(); int kullaniciSayisi = context.Users.Count(); return kullaniciSayisi; }
public static HaberUser kullaniciBilgiAlAdIle(string userAdi) { HaberContext context = new HaberContext(); RoleStore<HaberRole> roleStore = new RoleStore<HaberRole>(context); RoleManager<HaberRole> roleManager = new RoleManager<HaberRole>(roleStore); UserStore<HaberUser> userStore = new UserStore<HaberUser>(context); UserManager<HaberUser> userManager = new UserManager<HaberUser>(userStore); var kullanici = userManager.FindByName(userAdi); if (kullanici != null) { return kullanici; } else { return new HaberUser { }; } }
public EtiketHelper() { context = new HaberContext(); }
public HakkindaHelper() { context = new HaberContext(); }
public HaberClHelper(HaberContext tContext) { context = tContext; }
public YorumHelper(HaberContext tContext) { context = tContext; }
public YorumHelper() { context = new HaberContext(); }
public static int kategoriSayisi() { HaberContext context = new HaberContext(); int kategoriAdedi = context.Kategoriler.Count(); return kategoriAdedi; }
public static int yazarSayisi() { HaberContext context = new HaberContext(); int yazarAdedi = context.Yazarlar.Count(); return yazarAdedi; }
public static int haberSayisi() { HaberContext context = new HaberContext(); int haberAdedi = context.Haberler.Count(); return haberAdedi; }
public static string rolBilgisiAl(string rolAdi) { HaberContext context = new HaberContext(); RoleStore<HaberRole> roleStore = new RoleStore<HaberRole>(context); RoleManager<HaberRole> roleManager = new RoleManager<HaberRole>(roleStore); UserStore<HaberUser> userStore = new UserStore<HaberUser>(context); UserManager<HaberUser> userManager = new UserManager<HaberUser>(userStore); var role = roleManager.FindByName(rolAdi); if (role != null) { return role.Id; } else { return ""; } }
public HaberClHelper() { context = new HaberContext(); }
public KullaniciRepository() { _context = new HaberContext(); }
public List<HaberCl> TumHaberleriListele() { HaberContext context2 = new HaberContext(); var list = context2.Haberler.ToList(); return list; }
public KategoriHelper() { context = new HaberContext(); }
public HakkindaHelper(HaberContext tContext) { context = tContext; }
public KategoriRepository() { _context = new HaberContext(); }
public EtiketHelper(HaberContext tContext) { context = tContext; }
public ResimHelper(HaberContext tContext) { context = tContext; }
public static int yorumSayisi() { HaberContext context = new HaberContext(); int yorumSayisi = context.Yorumlar.Count(); return yorumSayisi; }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); HaberContext context = new HaberContext(); RoleStore<HaberRole> roleStore = new RoleStore<HaberRole>(context); RoleManager<HaberRole> roleManager = new RoleManager<HaberRole>(roleStore); UserStore<HaberUser> userStore = new UserStore<HaberUser>(context); UserManager<HaberUser> userManager = new UserManager<HaberUser>(userStore); if (!roleManager.RoleExists("SuperAdmin")) { HaberRole suRole = new HaberRole("SuperAdmin", "Sistem Ana Yöneticisi"); roleManager.Create(suRole); } var user = userManager.FindByName("SuperUser"); if (user == null) { HaberUser huser = new HaberUser { Name = "Super", SurName = "User", UserName = "******", EklenmeTarihi = DateTime.Now }; IdentityResult ir = userManager.Create(huser, "123456"); if (ir.Succeeded) { userManager.AddToRole(huser.Id, "SuperAdmin"); } } else { if (!userManager.IsInRole(user.Id, "SuperAdmin")) { userManager.AddToRole(user.Id, "SuperAdmin"); } } if (!roleManager.RoleExists("Admin")) { HaberRole adminRole = new HaberRole("Admin", "Yönetici"); roleManager.Create(adminRole); } if (!roleManager.RoleExists("User")) { HaberRole userRole = new HaberRole("User", "Okuyucu, yorum yazan"); roleManager.Create(userRole); } if (!roleManager.RoleExists("News Writer")) { HaberRole newsRole = new HaberRole("News Writer", "Haber yazarı"); roleManager.Create(newsRole); } }
public ResimHelper() { context = new HaberContext(); }
public YazarHelper() { context = new HaberContext(); }
public KategoriHelper(HaberContext tContext) { context = tContext; }
public static int etiketSayisi() { HaberContext context = new HaberContext(); int etiketSayisi = context.Etiketler.Count(); return etiketSayisi; }
public IletisimHelper() { context = new HaberContext(); }
public IletisimHelper(HaberContext tContext) { context = tContext; }
public ResimRepository() { _context = new HaberContext(); }
public HaberRepository() { _context = new HaberContext(); }