예제 #1
0
        public ActionResult Location()
        {
            UsersStoreContext context = HttpContext.RequestServices.GetService(typeof(ProiectTW.Models.UsersStoreContext)) as UsersStoreContext;

            list = context.GetAllUsersLocations(2);
            string markers = "[";

            foreach (Locations item in list)
            {
                markers += "{";
                markers += string.Format("'title': '{0}',", item.CityName);
                markers += string.Format("'lat': '{0}',", item.Latitude);
                markers += string.Format("'lng': '{0}',", item.Longitude);
                markers += string.Format("'description': '{0}'", item.Description);
                markers += "},";
            }
            markers        += "];";
            ViewBag.Markers = markers;
            return(View());
        }
예제 #2
0
        // GET: /<controller>/
        public IActionResult Index()
        {
            UsersStoreContext context = HttpContext.RequestServices.GetService(typeof(ProiectTW.Models.UsersStoreContext)) as UsersStoreContext;

            return(View(context.GetAllUsers()));
        }
예제 #3
0
 public UsersRepository(UsersStoreContext context)
 {
     this._context = context;
 }