http://formatmycsharpcode.blogspot.com
Örnek :
Code:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using aksaray1Model; using System.Collections; /// <summary> /// Summary description for ilanlaricek /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class ilanlaricek : System.Web.Services.WebService { [WebMethod] public string[] ilancek1(string prefixText) { aksaray1Entities1 yoneticiler = new aksaray1Entities1(); List<ilanlar> sonuc3 = (from d in yoneticiler.ilanlar where d.pozisyonadi.Contains(prefixText) || d.pozisyontipi.Contains(prefixText) select d).OrderBy(c => c.pozisyonadi).Take(5).ToList(); ArrayList sehirlist = new ArrayList(); foreach (var item in sonuc3) { sehirlist.Add(item.pozisyonadi); } return (string[])(sehirlist.ToArray(typeof(string))); } }
Hiç yorum yok:
Yorum Gönder