当前位置: 首页>>代码示例>>C#>>正文


C# DataService类代码示例

本文整理汇总了C#中DataService的典型用法代码示例。如果您正苦于以下问题:C# DataService类的具体用法?C# DataService怎么用?C# DataService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataService类属于命名空间,在下文中一共展示了DataService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ZGWSAMPLE_SRV_SendingRequest

        /// <summary>
        ///     The event handler of this entity container which occurs on each
        ///     Request sent to the serivce. 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ZGWSAMPLE_SRV_SendingRequest(object sender, System.Data.Services.Client.SendingRequestEventArgs e)
        {   
            HttpWebRequest webRequest = e.Request as HttpWebRequest;

            //ADN Modif
            ServiceDetails serviceDetail = null; // ConfigurationReaderHandler.Instance.GetServiceDetails("ZGWSAMPLE_SRV");
            
            if (serviceDetail == null)
            {
                serviceDetail = new ServiceDetails { Url = @"https://sapes1.sapdevcenter.com:443/sap/opu/odata/sap/ZGWSAMPLE_SRV/", Client = "", SSO = "BASIC" };
            }
			string language = System.Globalization.CultureInfo.CurrentUICulture.Name;
            webRequest.Headers["Accept-Language"] = language;
            BusinessConnectivityHelper.HandleSAPConnectivity(serviceDetail,ref webRequest);

			//The Below section helps you handle delta token. If you wish to use the details then pass the AtomDeltaToken back to your application.
            //To enable this section please set the value of "EnableDeltaToken" for the corresponding service to "Enabled".
            if (serviceDetail.HandleDeltaTokenDecision)
				{
					DataService dataService = new DataService();
					if (webRequest.Method == "GET")
						{
							HttpWebRequest clonedWebRequest = webRequest.CloneRequestForXSRFToken(webRequest.RequestUri.AbsoluteUri);
							HttpWebResponse webResponse = clonedWebRequest.GetResponse() as HttpWebResponse;
							if (webResponse.StatusCode == HttpStatusCode.OK)
								{
									string response = webResponse.ReadResponse();
									this.AtomDeltaToken = dataService.ReadResponse<AtomDeltaTokens>(response);
								}
						}
				}
			}
开发者ID:GetSomeRest,项目名称:integration-sap-view.and.data.api,代码行数:38,代码来源:ZGWSAMPLE_SRVExtension.cs

示例2: Test1

		public void Test1()
		{
			var ds = new DataService<NorthwindDB>();
			var mp = ds.GetService(typeof(IDataServiceMetadataProvider));


		}
开发者ID:akava,项目名称:bltoolkit,代码行数:7,代码来源:DataServiceTest.cs

示例3: AddRemoveCategory

        public void AddRemoveCategory()
        {
            var context = new CoreDataContext();
            var uow = new EntityFrameworkUnitOfWork(context);
            var repo = new EntityFrameworkRepository<Guid, Category, GuidIdInitializer>(context);

            var caregoryService = new DataService<Guid, Category, EntityFrameworkRepository<Guid, Category, GuidIdInitializer>>(uow, repo);

            var newCategory = caregoryService.Add(new Category
            {
                Name = "Computres",
                Categories = new List<Category>
                {
                    new Category { Name = "-DeskTops" },
                    new Category { Name = "-Servers" },
                    new Category { Name = "-Laptops", Categories = new List<Category>
                        {
                            new Category { Name = "--Tablets" },
                            new Category { Name = "--Shmablets" },
                        }
                    },
                }
            });

            var justAdded = caregoryService.Get(c => c.Id == newCategory.Id);
            Assert.AreEqual(justAdded.Categories.Count, newCategory.Categories.Count);

            caregoryService.Remove(justAdded);
            justAdded = caregoryService.Get(c => c.Id == newCategory.Id);
            Assert.IsNull(justAdded);
        }
开发者ID:multiton,项目名称:stream,代码行数:31,代码来源:CategoryTest.cs

示例4: MapViewModel

 public MapViewModel(INavigationResolver resolver, DataService.IGeoDataService service) 
 {
     _resolver = resolver;
     _service = service;
     Issues = new ObservableCollection<DataService.IssueItem>();
     InitData();
 }
开发者ID:CrappySolutions,项目名称:UtbildningService,代码行数:7,代码来源:MapViewModel.cs

示例5: when_a_customer_is_requested

        public when_a_customer_is_requested()
        {
            fakeDataService = A.Fake<DataService>();
            //A.CallTo(() => fakeDataService.AddMessage()).MustHaveHappened();

            handler = new GetIndex(fakeDataService);
        }
开发者ID:kpaligian,项目名称:simple_app,代码行数:7,代码来源:when_a_customer_is_requested.cs

示例6: SyncService

 /// <summary>
 /// Fire up the repos and service context in the constructor.
 /// </summary>
 /// <param name="oAuthorization"></param>
 public SyncService(OAuthorizationdto oAuthorization)
 {
     dataserviceFactory = new DataserviceFactory(oAuthorization);
     dataService = dataserviceFactory.getDataService();
     syncObjects = new Syncdto();
     syncRepository = new SyncRepository();
 }
开发者ID:jasonthenderson,项目名称:SampleApp-TimeTracking_Invoicing-DotNet,代码行数:11,代码来源:SyncService.cs

示例7: TestDeleteValue

 public void TestDeleteValue()
 {
     DataService dataService = new DataService();
     dataService.SetValue("TestKey", "TestValue");
     dataService.DeleteValue("TestKey");
     Assert.IsInstanceOf(typeof(KeyNotFoundException), dataService.GetValue("TestKey").ThrownException);
 }
开发者ID:SamuelCox,项目名称:Noise,代码行数:7,代码来源:DataServiceTest.cs

示例8: client_GetGestureDataCompleted

 void client_GetGestureDataCompleted(object sender, DataService.GetGestureDataCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         gestureInfo = SerializationHelper.Desirialize(e.Result);
         defBuilder.AddGesture(gestureInfo);
     }
 }
开发者ID:tuliosouza,项目名称:ASG,代码行数:8,代码来源:GestureDefinitionBuilder.xaml.cs

示例9: Load_Data

 private void Load_Data()
 {
     DataService dataservice = new DataService();
     dataSet = dataservice.GetSubjectAndWords();
     Page.Session["DataSet"] = dataSet;
     
    
 }
开发者ID:yanoovoni,项目名称:Rdroid,代码行数:8,代码来源:Targil11_13.aspx.cs

示例10: getAnswers

	//Metodo para obtener las  Respuestas desde la base de datos.
	public void getAnswers(){
		ds = new DataService("medicina.db");	/*Especifia nombre de la base de datos*/
		ds.CreateDB ();
		var respuestas=ds.GetRespuestas(); /*El numero 1 es el ID de la pregunta que estamos evaluando*/
		foreach(var respuesta in respuestas){
			answer = respuesta.Texto;
		}
	}
开发者ID:carlosm10,项目名称:ProyectoMedicina,代码行数:9,代码来源:CheckBox.cs

示例11: SqliteEntityLiteProvider

 public SqliteEntityLiteProvider(DataService dataService)
     : base(dataService)
 {
     if (DataService.ProviderName != ProviderName)
     {
         throw new InvalidOperationException(this.GetType().Name + " is for " + ProviderName + ". Not for " + DataService.ProviderName);
     }
 }
开发者ID:jesuslpm,项目名称:EntityLite,代码行数:8,代码来源:SqliteEntityLiteProvider.cs

示例12: LayDsQuyDinh

 public DataTable LayDsQuyDinh()
 {
     SqlCommand cmd = new SqlCommand("SELECT * FROM QUYDINH");
     DataService dS = new DataService();
     dS.Load(cmd);
     m_QuyDinhData = dS;
     return m_QuyDinhData;
 }
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:QuyDinhData.cs

示例13: XoaPhieuThu

 public int XoaPhieuThu(int SoPT)
 {
     SqlCommand cmd = new SqlCommand("dbo.Delete_PhieuThu");
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.Parameters.Add(new SqlParameter("@SoPT", SoPT));
     DataService dS = new DataService();
     return dS.ExecuteNoneQuery(cmd);
 }
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:PhieuThuData.cs

示例14: Main

        static void Main(string[] args)
        {
            DataService dataService = new DataService(new IntData());
            dataService.SendAndReceive();

            dataService.SetData(new StringData());
            dataService.SendAndReceive();
        }
开发者ID:igoroctaviano,项目名称:unclebob-potofcode,代码行数:8,代码来源:Program.cs

示例15: LayDsNhanVien

 public DataTable LayDsNhanVien()
 {
     SqlCommand cmd = new SqlCommand(TruyVanChung());
     DataService dS = new DataService();
     dS.Load(cmd);
     m_NhanVienData = dS;
     return m_NhanVienData;
 }
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:NhanVienData.cs


注:本文中的DataService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。