public IHttpActionResult Get(int id)
        {
            ResponseContent <KiralikBilgi> content;

            using (var kiralikBilgiBusiness = new KiralikBilgiBusiness())
            {
                // Get customer from business layer (Core App)
                List <KiralikBilgi> kiralikbilgiler = null;
                try
                {
                    var c = kiralikBilgiBusiness.SelectById(id);
                    if (c != null)
                    {
                        kiralikbilgiler = new List <KiralikBilgi>();
                        kiralikbilgiler.Add(c);
                    }

                    // Prepare a content
                    content = new ResponseContent <KiralikBilgi>(kiralikbilgiler);

                    // Return content as a json and proper http response
                    return(new XmlResult <KiralikBilgi>(content, Request));
                }
                catch (Exception)
                {
                    // Prepare a content
                    content = new ResponseContent <KiralikBilgi>(null);
                    return(new XmlResult <KiralikBilgi>(content, Request));
                }
            }
        }
示例#2
0
 public KiralikBilgi SelectKiralikBilgiById(int kiralikBilgiId)
 {
     try
     {
         using (KiralikBilgiBusiness kiralikBilgiBusiness = new KiralikBilgiBusiness())
         {
             return(kiralikBilgiBusiness.SelectById(kiralikBilgiId));
         }
     }
     catch (Exception)
     {
         throw;
     }
 }