Exemplo n.º 1
0
        public IHttpActionResult Get(int id)
        {
            ResponseContent <Sirket> content;

            using (var sirketBusiness = new SirketBusiness())
            {
                // Get customer from business layer (Core App)
                List <Sirket> sirketler = null;
                try
                {
                    var c = sirketBusiness.SelectById(id);
                    if (c != null)
                    {
                        sirketler = new List <Sirket>();
                        sirketler.Add(c);
                    }

                    // Prepare a content
                    content = new ResponseContent <Sirket>(sirketler);

                    // Return content as a json and proper http response
                    return(new XmlResult <Sirket>(content, Request));
                }
                catch (Exception)
                {
                    // Prepare a content
                    content = new ResponseContent <Sirket>(null);
                    return(new XmlResult <Sirket>(content, Request));
                }
            }
        }
Exemplo n.º 2
0
 public Sirket SelectSirketById(int sirketId)
 {
     try
     {
         using (SirketBusiness sirketBusiness = new SirketBusiness())
         {
             return(sirketBusiness.SelectById(sirketId));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }