How to implement a dynamic OData client in C#? [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Microsoft provides a WCF Data Services Client Library to implement OData clients in C#. This library works on the principle of creating a typed reference to the OData service.
What would be a good approach to implement an OData client in C# without having to previously generate a typed service interface? In other words, what would be a good way to implement an OData client in C# that could work with several different OData services, given the base URL and entity names as strings?
Such client would use dynamic C# objects or dictionaries to represent the entities, instead of typed entity objects.
Which existing libraries or projects could be leveraged to implement this?
One application of this technique would be to develop a generic functional test suite helper library that could be used to implement tests of OData services.

The pointer to odata-sdk above is definitely a good start. For one the OData Explorer which is also listed on that site is almost exactly what you're looking for. It's a general OData service "browser".
Another approach (maybe even better) would be to use Microsoft.Data.OData.dll. It's part of the latest CTP of WCF Data Services (http://blogs.msdn.com/b/astoriateam/archive/2011/10/13/announcing-wcf-data-services-oct-2011-ctp-for-net-4-and-silverlight-4.aspx).
It's a low-level reader and writer for OData. It doesn't solve the URL processing, but reading and writing the payloads works great.
There's a sample of a usage here: http://blogs.msdn.com/b/astoriateam/archive/2011/10/14/introducing-the-odata-library.aspx

you need nothing more than a URL/ String Parser for this , for more drill down approach you may also like to look at some options here:
http://www.odata.org/developers/odata-sdk

Related

C# RESTful Framework, not based on WCF [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'am looking for C# RESTful framework (best with json support), which is not based on WCF in any way. WCF requires me to create namespace reservations, and this is thing i'd like to avoid (i already tried Nancy). The thing is target PCs for my service are older Windows XP machines, where are registering tools missing (netsh has no http context).
Can anyone suggest me good solution?
Take a look here. it's really only an issue if you have a self hosted WCF service running along side IIS. Other then that, if you run inside IIS, you are the only thing listening to port 80, or you are listening to a different port, then you dont care about URL registration. you can also redirect the request from IIS to a different port on the same machine.
personally I really prefer WCF to all other and currently more popular alternatives, it gives you the best flexibility , and although it has a pretty significant learning curve, once you are "on top of the curve" gives you, in my opinion, the best "features developed / time invested" ratio
Excluding WCF, I think your best solution is this (as doan commented):ASP.Net Web Api combined with this (another site ) which is an open source project that microsoft pretty much adopted, and its all shown here
bare links:
http://msdn.microsoft.com/en-us/library/ms733768%28v=vs.110%29.aspx
http://www.asp.net/web-api
http://json.codeplex.com/
http://james.newtonking.com/json
http://www.asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization

Repository without Entity framework [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am fairly new to the Repository pattern (just got back from stone age, hi everyone :-). My dilemma is that I am need to develop a way my Windows Store app work with SQLite (SQLite-Net) today, and in a near future work off WCF services (or some non-direct database access). Basically I want to switch provider for my data access layer easily.
The best site I came across with example is this blog (http://blog.longle.net/2013/05/11/genericizing-the-unit-of-work-pattern-repository-pattern-with-entity-framework-in-mvc/)
But like any other place it still have heavy dose of Entity framework which I don't think applicable to my situation.
Can someone point out possible solutions or references that I can further work on ?
Thanks
Welcome back! I hope the food was good. :-)
You can implement the Repository pattern by writing your own data access layer (DAL) as an interface, and then just writing adapter classes to SQLite and WCF respectively, that both implement that interface. Your interface(s) would define query methods and update methods. For example, you can write the following:
public interface IWidgetRepository
{
// Query methods
Widget GetById(string id);
IEnumerable<Widget> GetFeaturedWidgets();
IEnumerable<Widget> GetRecommendedWidgetsForUser(string userId);
// Update methods
void RenameWidget(string id, string newName);
void UpdateWidgetPrice(string id, decimal newPrice);
}
See also this answer on a similar question; it goes into some more detail. You're in the same situation as in that question, even though it looks different on the surface because you're coming from a different starting point. But the solution is the same once you see how the underlying pattern works.

Automation testing framework for webservices [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am new to VS( about 6 months), we have an application built using WCF and I am looking for some pointer to build a automation framework around it.
I tried with soap UI but its too simple for my application, any suggestions/pointers where and how should I start building this framework( only option I see here is Nunit.
here is my requirement, I am looking more of step by step guide to achieve this
A simple framework which will send some precooked input to the service and will have some expected value, this expected value will then matched against the actual value assert.
This sounds like a good candidate for Visual Studio's Web & Load Test feature. I personally use these to test WCF endpoints frequently. You can either record steps using your browser, or write code that consumes your service. Either way, it functions just as a normal unit test does.

Reference for ASP.NET Identity needed [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
How do I use ASP.NET Identity into empty web projects?
I didn't do the google-ing for you, I just happened to be doing some research myself and came across the following resources.
Two good blog posts on odetocode.com here and here.
On the subject of empty web projects (taken from comments from above links):
People who want to start from scratch are usually looking to do something like create a .Domain or .Core assembly with their own definition of a user that can plug into the Identity framework. Unfortunately, this means you either take a dependency on the Entity Framework in a domain assembly (to inherit from IdentityUser) or re implement IUser and IUserStore from scratch. It's also much easier to use classes like ApplicationUser for a new application but a bit difficult to manage with an existing schema until you've figured out all the pieces (like how to do mapping with EF).
There is also the Identity Database template which has all the scripts, UDTs etc. used in ASP.NET Identity, available here.

Provide both REST and SOAP endpoints for webservices [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I was a great fun of Service Stack until it has gone commercial and they officially stopped the support of older versions. My main problem is that I want to be able to write a service and support both REST and SOAP xml. The reason being that most of my business clients work with WSDL and "Add service reference" but I have some other clients that would prefer to work with REST APIs as they follow the latest tech stacks.
Personally I have used the Agatha rrsl from the mighty Davy Brion but it is not actively maintained any more. I guess one could go the extra mile to maintain it on its own but I'd rather find another working framework.
Any ideas?
if you are interesting about SOAP, the free BSD version of ServiceStack 3.9.71, is excellent for you.
Do you think that you will need official support for SOAP updates ?
Is it mature enough ? I think yes , at least about your issue.
Nevertheless, in open source communities, there are always contributors.
There is not official support. Never, this is the answer.
Well of course Web API (http://www.asp.net/web-api) is one option. I also like Nancy (http://nancyfx.org/) a lot because it allows easily to change part of framework (like di container).

Categories