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); } }
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); } }