Exemplo n.º 1
0
        public bool SaveLogUrl(LogUrlBo log)
        {
            try
            {
                using (LodestoneEntitiesData context = new LodestoneEntitiesData())
                {
                    var logUrl = context.UrlLogs.Add(new UrlLog {
                        Url = log.Url, CreatedDate = DateTime.Now
                    });

                    if (context.SaveChanges() > 0)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        public List <ApartmentBo> GetAllApartments()
        {
            using (LodestoneEntitiesData context = new LodestoneEntitiesData())
            {
                var apartments = context.Apartments.Select(a => new ApartmentBo
                {
                    Address   = a.Address,
                    Bathrooms = a.Bathrooms,
                    Carports  = a.Carports,
                    City      = a.City,
                    Id        = a.Id,
                    Rooms     = a.Rooms,
                    Suburb    = a.Suburb,
                    Image     = a.Image
                }).ToList();

                return(apartments);
            }
        }