• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DataService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: XacNhanPhieuChi

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


示例17: LayDsKhoanChi

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


示例18: CapNhatTaiKhoanCo

        public static int CapNhatTaiKhoanCo(Int64 taiKhoanCo)
        {
            DataService m_QuyDinhData = new DataService();
            SqlCommand cmd = new SqlCommand("UPDATE QUYDINH SET TaiKhoanCo = TaiKhoanCo + @taiKhoanCo");
            cmd.Parameters.Add("taiKhoanCo", SqlDbType.BigInt).Value = taiKhoanCo;

            return m_QuyDinhData.Load(cmd);
        }
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:Utilities.cs


示例19: CapNhatTimKiemTuDong

        public static int CapNhatTimKiemTuDong(Boolean timKiemTuDong)
        {
            DataService m_QuyDinhData = new DataService();
            SqlCommand cmd = new SqlCommand("UPDATE QUYDINH SET TimKiemTuDong= @timKiemTuDong");
            cmd.Parameters.Add("timKiemTuDong", SqlDbType.Bit).Value = timKiemTuDong;

            return m_QuyDinhData.Load(cmd);
        }
开发者ID:hieu292,项目名称:ngocminh,代码行数:8,代码来源:Utilities.cs


示例20: ApiOnline

 public void ApiOnline()
 {
     Task.Run(async () =>
     {
         var ds = new DataService();
         Assert.IsTrue(await ds.ApiOnline());
     });
 }
开发者ID:famoser,项目名称:BeerCompanion,代码行数:8,代码来源:ApiTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataServiceContext类代码示例发布时间:2022-05-24
下一篇:
C# DataSeries类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap