wcf-data-services

Libraries for ADO.NET to rapidly bulk insert data into a database from a .csv file?

狂风中的少年 提交于 2019-11-27 20:17:23
I'd like to know if you can recommend any advanced ADO.NET libraries for working with databases. I've discovered that LINQ-to-Entities is great for pulling data out of databases, but not at all useful for inserting data into databases. Its missing functionality like fast bulk insert, culling of duplicates, and most of the advanced functionality you can achieve with pure SQL. So: can you recommend some ADO.NET libraries that offer the sorts of advanced functionality that LINQ-to-Entities is missing? The ADO.net SqlBulkCopy class enables quick, mass upload of records into a table: DataTable dt =

How to create a computed property in Data Services (OData)?

微笑、不失礼 提交于 2019-11-27 18:28:06
问题 I am creating an OData service with WCF Data Services using an EDMX. How can I create a computed property for an entity type, so that its value gets computed in the service (C#) and does not come from the database? The value of this property is based on the value of other properties, which are mapped to fields in the database. 回答1: If you are exposing your EDMX file directly, using the default Entity Framework Provider for Data Services, something like this: public class MyService:

Transfer large amount of data in WCF service

前提是你 提交于 2019-11-27 17:28:11
I have created a web service in WCF which returns more than 54000 data-rows with 10 data in each row. I have used the wsHttpBinding for communication. The service works well with less data (i.e. 2000 rows) but it bombs out when attempting to send large record set with 50000+ rows(~2MB). The exception message is like this An error occurred while receiving the HTTP response to http://localhost:9002/MyService.svc . This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the

What is the implementing class for IGrouping?

折月煮酒 提交于 2019-11-27 14:37:09
I am trying create a WCF Data Services ServiceOperation that does grouping on the server side and then sends the data down to the client. When I try to call it (or even connect to the service) I get an error. It says that it can't construct an interface. The only interface I am using is IGrouping. What is a/the actual class for this interface? Update: I checked the type while debugging a sample app and it told me it was: System.Linq.Lookup<TKey,TElement>.Grouping But what assembly is it in? Several types in the BCL implement IGrouping , however they are all internal and cannot be accessed

Using enums in WCF Data Services

孤街醉人 提交于 2019-11-27 13:00:29
问题 I'm trying to manually build a WCF Data Service using a POCO data model and I cannot figure out how to properly expose enum values. Assuming a simple model like: public class Order { public int ID {get; set;} public string Description {get; set;} public OrderStatus Status {get; set;} } public enum OrderStatus { New, InProcess, Complete } How do you expose the valuable information in the OrderStatus property via the OData WCF Data Service? If you do nothing, the Data Service generates a

Microsoft.Data.Services.Client.dll vs System.Data.Services.Client.dll

倾然丶 夕夏残阳落幕 提交于 2019-11-27 07:38:38
问题 I'm trying to use WCF Data Services and a little confused what library should I reference to interact with WCF Data Services: Microsoft.Data.Services.Client.dll or System.Data.Services.Client.dll . What is the difference between them? In which case should I use each of them? When trying to add references to both of them I get a compiler error: The type 'System.Data.Services.Client.DataServiceContext' exists in both 'e:\Program Files\WCF Data Services Mar 2011 CTP2\bin.NETFramework\Microsoft

Dispatcher BeginInvoke Syntax

故事扮演 提交于 2019-11-27 05:19:20
问题 I have been trying to follow some WCF Data Services examples and have the following code: private void OnSaveCompleted(IAsyncResult result) { Dispatcher.BeginInvoke(() => { context.EndSaveChanges(result); }); } Which is called by the following: this.context.BeginSaveChanges(SaveChangesOptions.Batch, this.OnSaveCompleted, null); Now I am getting a little confused here. Firstly, the first bit of code is showing a syntax error of "Argument type lambda expression is not assignable to parameter

How to handle Ajax JQUERY POST request with WCF self-host

隐身守侯 提交于 2019-11-27 04:16:24
There are many reasons create a RESTful WCF server (it is easy) and even better if you can avoid ASP and it's security box (if all you are doing is simple requests to return information). See: http://msdn.microsoft.com/en-us/library/ms750530.aspx on how to do this. What I found is that handling AJAX (JQUERY) GET requests is easy. But dealing with JSON in a POST is tricky. Here is an example of a simple GET request contract: [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json)] String Version(); And the implementaion is here (which returns a JSON) public partial class

Sequence contains no matching element - EntityFramework

末鹿安然 提交于 2019-11-27 03:46:56
问题 I'm using EF 6.1.0 and was creating a WCF Service. First I created a Class Library containing my entities, Mappers and Context for initializing EF. I've also created a class containing an instantiation of the context and have this code: public IQueryable<[Entity]> GetAll() { return context.[Entity].AsQueryable(); } On the otherhand, I've created a WCF Service on the same project and Calls the function GetAll() in the.svc file like this: public List<[Entity]> GetList() { [iObject] repository =

WCF Data Service - How To Diagnose Request Error?

依然范特西╮ 提交于 2019-11-27 02:37:30
问题 I have an application which will use WCF to serve up various chunks of data to clients. However, due to the size of some of the sets of data that will be returned (and that's because the client app needs to show a large number of objects in a list, not because I've just been lazy in the design) I'm hitting the message size limits. I expected this, and planned to implement data paging / response streaming (I believe Pablo Cibraro wrote an article on this once). However, I've seen some demos