public async Task <ResponceModel> Get([FromRoute] int id) { try { var district = await districtService.Get(id); return(new ResponceModel(200, "OK", district, 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çe getirilirken bir sorun oluştu." })); } }
public ActionResult <List <District> > Get() { return(_districtService.Get()); }
[HttpGet("{id}")] // GET api/district/5 public District Get(long id) { return(_service.Get(id)); }