Ejemplo n.º 1
0
 public KategoriController(IKategoriService kategoriService)
 {
     _kategoriService = kategoriService;
 }
Ejemplo n.º 2
0
        public static async Task SeedData(UserManager <AppUser> userManager, RoleManager <AppRole> roleManager, IKategoriService kategoriService, ITagService tagService)
        {
            var adminRole = await roleManager.FindByNameAsync(RoleNames.Admin.ToString());

            if (adminRole == null)
            {
                await roleManager.CreateAsync(new AppRole { Name = RoleNames.Admin.ToString() });
            }

            var memberRole = await roleManager.FindByNameAsync(RoleNames.Member.ToString());

            if (memberRole == null)
            {
                await roleManager.CreateAsync(new AppRole { Name = RoleNames.Member.ToString() });
            }
            var modRole = await roleManager.FindByNameAsync(RoleNames.Moderator.ToString());

            if (modRole == null)
            {
                await roleManager.CreateAsync(new AppRole { Name = RoleNames.Moderator.ToString() });
            }
            var valRole = await roleManager.FindByNameAsync(RoleNames.Validator.ToString());

            if (valRole == null)
            {
                await roleManager.CreateAsync(new AppRole { Name = RoleNames.Validator.ToString() });
            }
            var wriRole = await roleManager.FindByNameAsync(RoleNames.Writer.ToString());

            if (wriRole == null)
            {
                await roleManager.CreateAsync(new AppRole { Name = RoleNames.Writer.ToString() });
            }

            var adminUser = await userManager.FindByNameAsync("mustafa");

            if (adminUser == null)
            {
                AppUser user = new AppUser
                {
                    UserName = "******",
                    Email    = "*****@*****.**"
                };
                await userManager.CreateAsync(user, "mustafa");

                await userManager.AddToRoleAsync(user, RoleNames.Admin.ToString());
            }
            var kategoriler = kategoriService.GetAll();

            if (kategoriler.Result.Count < 1)
            {
                await kategoriService.Add(new Kategori()
                {
                    KategoriIsmi = "Hakkımda"
                });

                await kategoriService.Add(new Kategori()
                {
                    KategoriIsmi = "İletisim"
                });

                await kategoriService.Add(new Kategori()
                {
                    KategoriIsmi = "Karalamalar"
                });
            }
            var tagler = tagService.GetAll();

            if (tagler.Result.Count < 1)
            {
                await tagService.Add(new Tag()
                {
                    TagName = "Duygusal",
                    //AppUser = userManager.FindByNameAsync("mustafa").Result,
                    AppUserId = userManager.FindByNameAsync("mustafa").Result.Id
                });;
                await tagService.Add(new Tag()
                {
                    //AppUser = userManager.FindByNameAsync("mustafa").Result,
                    TagName   = "Yenilikçi",
                    AppUserId = userManager.FindByNameAsync("mustafa").Result.Id
                });

                await tagService.Add(new Tag()
                {
                    //AppUser = userManager.FindByNameAsync("mustafa").Result,
                    TagName   = "İşe yarar",
                    AppUserId = userManager.FindByNameAsync("mustafa").Result.Id
                });
            }
        }
Ejemplo n.º 3
0
 public KategoriController(IKategoriService _kategoriService, IMapper _mapper)
 {
     kategoriService = _kategoriService;
     mapper          = _mapper;
 }
Ejemplo n.º 4
0
 public Kategoriler(IKategoriService kategoriService, IMapper mapper)
 {
     _kategoriService = kategoriService;
     _mapper          = mapper;
 }
Ejemplo n.º 5
0
 // GET: Tarifler
 public TariflerController(IUrunService urunService, IMalzemeService malzemeService, ITarifService tarifService, IKategoriService kategoriService, IKategoriTurService kategoriTurService)
 {
     _kategoriTurService = kategoriTurService;
     _kategoriService    = kategoriService;
     _tarifService       = tarifService;
     _malzemeService     = malzemeService;
     _urunService        = urunService;
 }
Ejemplo n.º 6
0
 public HomeController(IKategoriService ks)
 {
     _ks = ks;
 }
 public CategoriesController(IKategoriService kategoriService)
 {
     _kategoriService = kategoriService;
 }
Ejemplo n.º 8
0
 public KategorilerController(IKategoriService categoryService, IMapper mapper)
 {
     _categoryService = categoryService;
     _mapper          = mapper;
 }
Ejemplo n.º 9
0
 public UrunController(IMapper _mapper, IUrunService _urunService, IKategoriService _kategoriService)
 {
     mapper          = _mapper;
     urunService     = _urunService;
     kategoriService = _kategoriService;
 }