Exemple #1
0
        public async Task <ResponceModel> GetAll([FromQuery(Name = "text")] string text, [FromQuery(Name = "page")] int page = 1, [FromQuery(Name = "offset")] int offset = 20)
        {
            try
            {
                var districts = await districtService.GetAll(text, page, offset);

                return(new ResponceModel(200, "OK", districts, null));
            }
            catch (Exception ex)
            {
                await _logService.Add(new SystemLog()
                {
                    Content = ex.Message, CreateDate = DateTime.Now, UserId = 0, EntityName = districtService.GetType().Name
                });

                return(new ResponceModel(500, "ERROR", null, new string[] { "İlçeler getirilirken bir sorun oluştu." }));
            }
        }
 public ActionResult Index()
 {
     return(View(semtservisi.GetAll()));
 }
 [HttpGet] // GET api/district
 public IEnumerable <District> Get()
 {
     return(_service.GetAll());
 }