ASP.NET Web API is a framework for building HTTP services for clients like browsers and mobile devices. It is based on the Microsoft .NET Framework and ideal choice for building RESTful services.
3
votes
2answers
54 views
Multiple connection string in Web API 2
I have a Web API 2 using Dapper.net, and it's accessed by various client with their own database. Currently, I'm using custom header called Client-Id to identify ...
2
votes
0answers
12 views
Lazy WebAPI object
I am working to design an object which would abstract away the use of a WebAPI. I want the developer to be able to use these objects as if they are using a traditional API.
My core problem is how to ...
0
votes
0answers
10 views
Generating dual .xlsx files and .htm pages of the same data [migrated]
Here are my requirements:
Generate Excel reports for users, attaching them to emails
Additionally, insert hyperlinks into those emails where the user can view the same report on a web page.
I have ...
1
vote
1answer
93 views
AngularJS: Http API Service - any improvements / remarks?
Could you please review the below AngularJS service. What it does is centralize all (relevant) HTTP action calls.
Do you see any chances for improvement?:
...
0
votes
2answers
91 views
Async - await all the way
Related to this question (and even this Stack Overflow's one) I have been trying to avoid blocking the code. So what I understood it's that is preferable to make all the methods that rely on an async ...
1
vote
1answer
54 views
Change implementation from getting json from file to get it from API
I used to get a JSON file with some configuration settings from the file system, using this class:
...
0
votes
1answer
87 views
Method GetById and SingleResult
Here is my method that I use to get one entity in an ASP.NET Web API application.
...
3
votes
1answer
135 views
Controller class pattern
The GetDropdownList() function is being called on a couple of controllers based on this example and it may be called in many other controllers, so this code is ...
1
vote
1answer
52 views
Using custom negotiator and custom formatter in Web API 2
Here's my custom formatter which I want to use for "application/x.product" content type:
...
3
votes
1answer
118 views
Choose the right type for method GetById
I designed my repository class and I need some advice from you. Now I have a method GetByID that returns a generic type:
...
2
votes
1answer
59 views
Method that return related entities using OData
There is method GetFull that should use OData return related entities.
When I call GetFull(12, "entity1,entity2") then I will ...
1
vote
0answers
95 views
Create JSON object from self-nested LINQ query
I created this function to created nested JSON object using a Linq query. How can I optimize this and make it more readable?
...
3
votes
1answer
89 views
WebApi action that updates entity using stored procedure
I have ASP.NET WebApi project. Some of controller has method SetAsMain(int id) that get information about people then use stored procedure update people. How can I ...
3
votes
1answer
270 views
Run stored procedure from repository using EF
I need to dynamically call a stored procedures from my repository, and here is a my implementation:
...
5
votes
1answer
214 views
Implementation Async/Await
I have a simple ASP.NET Web API project. Now I want to make all basic methods as asynchronous. I tried to do something, and it's working but I'm not sure that it was implemented properly.
Please ...
3
votes
1answer
200 views
N-tiered web app to save a role
My project manager is saying that there are many bad things in my code, but they are not helping me to correct it. Can you please specify the bad things they mean?
I have 7 projects in my solution ...
3
votes
1answer
91 views
3
votes
2answers
159 views
MVC-Web API 2 integration
For the first time ever, I'm integrating an MVC website to an ASP.NET Web API 2 web service (both of which are coded by myself).
I'd appreciate it if you can just look this over for me and let me ...
5
votes
1answer
110 views
WebAPI Client Proxy
I'm working on a client proxy for my WebAPI. I've looked at WebApiProxy but I feel DTOs are unnecessary in my scenario.
I made an ...
2
votes
0answers
287 views
Web API 2 - JWT with X509 certificate
I got my JWT generation working with X509 and wanted to ask if you would recommend any changes in respect to:
Signing certificate storing / handling.
Publishing for anonymous access public key
...
6
votes
2answers
459 views
Web API using Repository / UnitOfWork
I'm looking for feedback on a repository I set up based on a blog post I read here.
I have just recently got more into .NET within the past year, so any feedback and/or best practices that can be ...
1
vote
1answer
142 views
Dependency injection thread safety
Is it OK to mix different lifetime of ISerializer and ICacheProvider in this case? I am using Unity DI. In this case, whenever ...
3
votes
1answer
1k views
Identity repository pattern with unit of work
I am creating simple web api/ SPA application using EntityFramework, IUnitOfWork, Repository pattern, Unity DI along with Asp.net Identity.
Unity configuration
...
3
votes
1answer
2k views
Automating CRUD using Repository Pattern, Web API and TypeScript
I would like a review of the following application, esp with how I'm registering and selecting the controllers.
First I defined a generic Repository interface and implementation using EF 6.1.2:
...
9
votes
5answers
246 views
Multiple 'using' statements in method implementation
I'm learning WebAPI framework for ASP.NET and C#. Is the following way of handling incoming data correct?
...
5
votes
2answers
243 views
Self-contained poll application
I am working on a small and self-contained poll application, not unlike Straw Poll whereby one user can submit a poll and other users can vote (but only once).
I am building this little application ...
4
votes
3answers
2k views
.NET REST API JSON Filtering
My question, REST API and lazy loading objects, didn't receive any answers (or many views), so here is my attempt at the solution.
Problem overview:
My mobile app requests a list of objects through a ...
4
votes
1answer
575 views
WebAPI controller
It return an object with WebAPI by proving some data. Is this a good approach?
...
11
votes
1answer
707 views
Small android app that gives a movie based on the chosen genre
Working on my first "big" project using the mighty Xamarin. Likewise my first venture in XAML so I suppose most focus will be going towards these new areas. Performance- and user-experience related ...
3
votes
1answer
615 views
Make a testable DAL using service and repository pattern
I'm implementing a Web API that communicates with old WCF services and want to make it future proof.
The Web API consists of:
API controllers
Service Providers
Repositories
I've implemented a ...
2
votes
2answers
540 views
Different Approach to the following ASP.NET Web API Action
Maybe someone here can help me sort out this implementation and make it better.
First the following constraints:
1 Controller & Action that accepts all post requests, these post requests will ...
4
votes
1answer
1k views
.NET WCF Activator for sync and async calls
I decided to re-write my code responsible for WCF calls, as all of my methods had try-catch-...
5
votes
2answers
2k views
Checking for new software updates to the client
I have written a very simple web service with MVC and WebApi. Now I'm working on the client code which will be a WPF application (and soon Windows 8 Store/Phone app). What I have done works, but I'm ...
12
votes
1answer
11k views
Web API 2 authentication with JWT
Please review my code for bearer token (JWT) authentication of Web API 2 (Self Hosted using OWIN)
Are there any security issues in the implementation?
Quick overview:
Token creation and validation ...