public List <ListIlanProfileDto> GetList()
        {
            using (var ctx = new EmlakfOfisiContext())
            {
                var list = ctx.Set <Ilan>().Select(y => new ListIlanProfileDto()
                {
                    Fiyat               = y.Fiyat,
                    BanyoSayisi         = y.BanyoSayisi,
                    CityName            = y.City.CityName,
                    CountryName         = y.Country.CountryName,
                    EmlakTuru           = y.EmlakTuru.EmlakTuruAdi,
                    BinaToplamKatSayisi = y.BinaToplamKatSayisi,
                    BulunduguKat        = y.BulunduguKat,
                    GorselLinki         = y.GorselLinki,
                    IlanBasligi         = y.IlanBasligi,
                    IlanIcerigi         = y.IlanIcerigi,
                    OdaSayisi           = y.OdaSayisi,
                    Tur             = y.Tur,
                    EmlakYasi       = y.EmlakYasi,
                    Metrekare       = y.Metrekare,
                    OlusturmaTarihi = y.CreatedDate,
                    EmlakciAdi      = y.User.Ad,
                    EmlakciSoyadi   = y.User.Soyad
                }).OrderByDescending(x => x.OlusturmaTarihi).ToList();

                return(list);
            }
        }
示例#2
0
 public MemberController(EmlakfOfisiContext context, UserManager <User> userManager, RoleManager <Role> roleManager, SignInManager <User> signInManager)
 {
     this._context       = context;
     this._userManager   = userManager;
     this._roleManager   = roleManager;
     this._signInManager = signInManager;
 }
        public List <CreateRoleDto> GetRolesList()
        {
            using (var ctx = new EmlakfOfisiContext())
            {
                var list = ctx.Set <Role>().Select(y => new CreateRoleDto()
                {
                    Name = y.Name
                }).ToList();

                return(list);
            }
        }
        public List <UpdateUserDto> GetUserList()
        {
            using (var ctx = new EmlakfOfisiContext())
            {
                var list = ctx.Set <User>().Select(y => new UpdateUserDto()
                {
                    Ad       = y.Ad,
                    Soyad    = y.Soyad,
                    Email    = y.Email,
                    FirmaAdi = y.FirmaAdi,
                    Id       = y.Id,
                    UserName = y.UserName
                }).ToList();

                return(list);
            }
        }
 public IlanController(IIlanService ilanService, EmlakfOfisiContext context)
 {
     this._ilanService = ilanService;
     this._context     = context;
 }