Beispiel #1
0
        // GET: api/Sirket/5
        public IHttpActionResult Get(int id)
        {
            ResponseContent <Sirket> content;

            using (var SirketBusiness = new SirketBusiness())
            {
                List <Sirket> sirket = null;
                try
                {
                    var c = SirketBusiness.SelectedIdSirket(id);
                    if (c != null)
                    {
                        sirket = new List <Sirket>();
                        sirket.Add(c);
                    }
                    content = new ResponseContent <Sirket>(sirket);

                    return(new XmlResult <Sirket>(content, Request));
                }
                catch (Exception)
                {
                    content = new ResponseContent <Sirket>(null);
                    return(new XmlResult <Sirket>(content, Request));
                }
            }
        }